CN115115901A - Method and device for acquiring cross-domain learning model - Google Patents

Method and device for acquiring cross-domain learning model Download PDF

Info

Publication number
CN115115901A
CN115115901A CN202210581106.XA CN202210581106A CN115115901A CN 115115901 A CN115115901 A CN 115115901A CN 202210581106 A CN202210581106 A CN 202210581106A CN 115115901 A CN115115901 A CN 115115901A
Authority
CN
China
Prior art keywords
training
data
meta
domain
cross
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.)
Pending
Application number
CN202210581106.XA
Other languages
Chinese (zh)
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.)
Hangzhou Alibaba Overseas Internet Industry Co ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210581106.XA priority Critical patent/CN115115901A/en
Publication of CN115115901A publication Critical patent/CN115115901A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/431Frequency domain transformation; Autocorrelation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/809Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of classification results, e.g. where the classifiers operate on the same input data
    • G06V10/811Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of classification results, e.g. where the classifiers operate on the same input data the classifiers operating on different input data, e.g. multi-modal recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application discloses a method and a device for acquiring a cross-domain learning model. The method comprises the following steps: acquiring training data from a plurality of source domains; training data from one part of the source domains is used as meta-training data, and training data from another part of the source domains is used as meta-test data; training a cross-domain learning model using meta-training data and meta-testing data, the training objectives comprising: the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game; and the output result of the cross-domain learning model for the meta-training data and the meta-testing data is in accordance with expectation; the trained cross-domain learning model is used for analyzing and predicting input data from a target domain, and outputting a prediction result, wherein the target domain is one of the source domains or other domains except the source domains. The cross-domain generalization performance of the model can be improved through the method and the device.

Description

Method and device for acquiring cross-domain learning model
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for acquiring a cross-domain learning model.
Background
Machine learning is a core component in the field of artificial intelligence and is increasingly widely used in various scenes. Machine learning is a method of analyzing and predicting data using a machine learning model. May include classification models, regression models, ranking models, timing prediction models, and the like.
With the increasing popularity of machine learning applications, more and more models have cross-domain requirements. For example, in an image recognition scenario, an image recognition model established for images in some of the domains (domains) can also be applied to image recognition in other domains. For example, in an information recommendation scene, an information recommendation model established for some fields can also be applied to information recommendation of other fields. That is to say, the cross-domain learning model which needs to be obtained has relatively good generalization performance. However, the generalization performance of the currently available method for obtaining the cross-domain learning model is poor, and the method can only have a good effect in the field to which the training data belongs, and has a poor effect in other fields.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for obtaining a cross-domain learning model, so as to improve the cross-domain generalization performance of the model.
The application provides the following scheme:
according to a first aspect, there is provided a method of obtaining a cross-domain learning model, the method comprising:
acquiring training data from a plurality of source domains;
taking training data from one part of the source domains as meta-training data, and taking training data from the other part of the source domains as meta-test data;
training the cross-domain learning model by using the meta-training data and the meta-test data, wherein training targets comprise a first training target and a second training target; the first training target is: the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game; the second training target is: the output results of the cross-domain learning model aiming at the meta training data and the meta testing data are in accordance with expectations;
the trained cross-domain learning model is used for analyzing and predicting input data from a target domain, and outputting a prediction result, wherein the target domain is one of the source domains or other domains except the source domains.
According to an implementable manner in an embodiment of the present application, before the step of using training data derived from one part of the source domains as meta-training data and using training data derived from another part of the source domains as meta-test data, the method further includes:
and respectively carrying out Fourier amplification on the training data from the plurality of source domains to obtain the training data of each source domain after the amplification.
According to an implementable manner in an embodiment of the present application, the method further comprises: constructing a first data set and a second data set by using the meta-training data, acquiring an intersection of the first data set and the second data set as a third data set, and acquiring a union of the first data set and the second data set as a fourth data set;
training the cross-domain learning model using the meta-training data and the meta-testing data comprises: performing meta-training on the cross-domain learning model by respectively utilizing the first data set, the second data set, the third data set and the fourth data set to obtain a first model parameter, a second model parameter, a third model parameter and a fourth model parameter; respectively obtaining a first loss function value, a second loss function value, a third loss function value and a fourth loss function value corresponding to the first model parameter, the second model parameter, the third model parameter and the fourth model parameter of the meta-test data;
the first training objective comprises: minimizing a difference obtained by subtracting the sum of the first loss function and the second loss function value from the sum of the third loss function value and the fourth loss function value.
According to an implementable manner in an embodiment of the present application, the training comprises:
determining the value of the total loss function in each iteration, and updating the model parameters by using the value of the total loss function until the preset training end condition is met;
wherein the total loss function is obtained by performing a weighted summation on a fifth loss function and a sixth loss function, the fifth loss function is pre-constructed according to the first training objective, and the sixth loss function is pre-constructed according to the second training objective.
According to an implementable manner in an embodiment of the present application, the method further comprises:
determining a contribution score of the training data to the first training objective;
deleting the training data with contribution degree scores meeting a preset low-quality score standard from the training data;
updating model parameters using the training data obtained after the deleted processing to achieve the second training objective.
According to an implementable manner in an embodiment of the present application, determining the contribution score of the training sample to the first training goal includes:
determining a contribution score of a training sample to the first training target by using a product of a gradient of a fifth loss function to the training sample and the feature representation of the training sample; wherein the fifth loss function is pre-constructed according to the first training objective.
According to an implementable manner in an embodiment of the present application, the training data of the plurality of source domains includes: the image recognition method comprises the following steps that images of multiple fields and classification labels thereof are obtained, and the cross-domain learning model is an image recognition model; or,
the training data for the plurality of source domains comprises: the cross-domain learning model is an information recommendation model.
According to a second aspect, there is provided an apparatus for obtaining a cross-domain learning model, the apparatus comprising:
a sample acquisition unit configured to acquire training data derived from a plurality of source domains;
the sample dividing unit is configured to take training data from one part of the source domains as meta-training data and take training data from the other part of the source domains as meta-testing data;
a model training unit configured to train the cross-domain learning model using the meta training data and the meta test data, training objectives including a first training objective and a second training objective; the first training target is: the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game; the second training target is: the output results of the cross-domain learning model aiming at the meta-training data and the meta-testing data are in accordance with expectations;
the trained cross-domain learning model is used for analyzing and predicting input data from a target domain, and outputting a prediction result, wherein the target domain is one of the source domains or other domains except the source domains.
According to a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of any of the first aspects described above.
According to a fourth aspect, there is provided an electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the steps of the method of any of the first aspects described above.
According to the specific embodiments provided by the present application, the present application can have the following technical effects:
1) this application introduces the training of cross-domain learning model with the supermode of convex game, encourages the training data in each field to make contributions for improving model generalization performance for cross-domain learning model can utilize the information in the different fields better, learns the model that generalization performance is stronger, improves the model effect of model in other fields except source field.
2) The Fourier augmentation technology is adopted to augment the training data of the source domain, so that the diversity of the training data can be increased, and the generalization performance of the cross-domain learning model can be better improved.
3) Based on the contribution degree score of the training data to the first training target, the low-quality training samples with scores meeting the preset low-quality scoring standard are filtered, so that the negative influence of noise data and redundant data on cross-domain learning can be avoided, the promotion of the training data on the generalization performance of the model is effectively guaranteed, and the more stable model is learned.
Of course, it is not necessary for any product to achieve all of the above-described advantages at the same time for the practice of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required in the embodiments will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 illustrates an exemplary system architecture diagram to which embodiments of the present application may be applied;
fig. 2 is a flowchart of a method for acquiring a cross-domain learning model according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating a basic principle of model training according to an embodiment of the present disclosure;
FIG. 4 shows a schematic block diagram of an apparatus for obtaining a cross-domain learning model according to one embodiment;
fig. 5 is an architecture diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments that can be derived from the embodiments given herein by a person of ordinary skill in the art are intended to be within the scope of the present disclosure.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the description of the invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
To facilitate an understanding of the present application, a brief description of the system architecture on which the present application is based will first be provided. Fig. 1 shows an exemplary system architecture to which an embodiment of the present application may be applied, and as shown in fig. 1, the system mainly includes a device for acquiring a cross-domain learning model and a data warehouse of N domains, where N is a positive integer greater than 1.
The device for acquiring the cross-domain learning model acquires relevant data of N fields from the data warehouse as training data, and trains the cross-domain learning model. The purpose is to enable the obtained cross-domain learning model to analyze and predict input data of the N fields to obtain accurate prediction results, and also to analyze and predict input data of other fields (represented as N +1 fields in FIG. 1) except the N fields to obtain accurate prediction results, namely to enable the cross-domain learning model to have cross-domain generalization performance.
The cross-domain learning model may be a classification model, a regression model, a ranking model, a time series prediction model, or the like. The prediction results may be classification results, regression prediction results, ranking results, numerical prediction results at a specific time, and the like.
The domains may be different service domains, different regions, different types of data sets, etc.
The device for acquiring the cross-domain learning model can be arranged at a server side and also can be arranged at a computer terminal with strong computing power. The server side can be a single server, a server group formed by a plurality of servers, or a cloud server. The cloud Server is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPs) service.
It should be understood that the number of data warehouses and realms in FIG. 1 is merely illustrative. There may be any number of data repositories and domains, as desired for an implementation.
Fig. 2 is a flowchart of a method for acquiring a cross-domain learning model according to an embodiment of the present disclosure, where the method is performed by an apparatus for acquiring a cross-domain learning model in the system shown in fig. 1, and the apparatus may be an application located at a server end, or may also be a functional unit such as a plug-in or Software Development Kit (SDK) in an application located at a server end, or may also be located in a computer terminal with strong computing power. As shown in fig. 2, the method comprises the steps of:
step 202: training data derived from a plurality of source domains is obtained.
Step 204: training data originating from one portion of the source domains is used as meta-training data, and training data originating from another portion of the source domains is used as meta-test data.
Step 206: training a cross-domain learning model by using meta-training data and meta-testing data, wherein the training targets comprise a first training target and a second training target; the first training objective is: the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game; the second training target is: the output results of the cross-domain learning model aiming at the meta-training data and the meta-testing data are in accordance with expectations; the trained cross-domain learning model is used for analyzing and predicting the input data from the source domain or the input data from other domains except the source domain, and outputting a prediction result.
In the embodiment of the application, the existing field used by the training cross-domain learning model is called a source domain, and the supermodel of the convex game is introduced into the training of the cross-domain learning model, so that the cross-domain learning model can better utilize information in different fields to learn the model with stronger generalization performance, and the model effect of the model in other fields except the source domain is improved.
The above steps are described in detail below. The above step 202 of "acquiring training data derived from a plurality of source domains" will be described in detail first with reference to the embodiments.
In this embodiment, an existing domain having a certain amount of data may be used as the source domain. The content of the training data is related to the specific application scenario and model type. For supervised learning type models, the training data will typically include samples and labels for the samples.
For example, in an image recognition application scenario, image samples of multiple domains and their classification labels may be used as training samples to train an image recognition model. Wherein the fields may be different service fields, such as medical field, scientific field, entertainment field, etc. Or different types of data sets, such as paintings, sketches, cartoons, photographs, silhouettes, etc.
For another example, in an information recommendation application scenario, users in multiple countries and popularization data focused by the users may be used as training data to train the information recommendation model. The countries are different fields divided according to different regions.
Furthermore, in order to increase the diversity of the training data of the source domain and better improve the generalization performance of the model, Fourier (Fourier) amplification may be performed on the training data from the plurality of source domains, respectively, to obtain the training data of each source domain after the amplification. As shown in FIG. 3, assume that the acquired training data for multiple source domains is represented as D s Fourier amplification is carried out to obtain amplification data
Figure BDA0003663764050000051
Will be provided with
Figure BDA0003663764050000052
As augmented training data.
The fundamental semantics of the original signal are preserved due to the phase component of the fourier spectrum, while the amplitude component contains low-level statistical features. Therefore, the training data may be fourier-transformed to obtain an amplitude component and a phase component, the amplitude component may be disturbed to generate a new amplitude component while retaining the basic semantic information included in the phase component, and the phase component and the new amplitude component may be used to perform inverse fourier transform to obtain the augmented data.
When the amplitude component is disturbed, a random disturbance mode may be adopted, linear interpolation processing of the amplitude component may also be performed on two training samples in training data of any source domain, amplitude components of any two training samples may also be exchanged, and the like.
The above step 204, that is, "using training data from one part of the source domains as meta-training data, and using training data from another part of the source domains as meta-test data" will be described in detail below with reference to the embodiments.
The step is actually to divide the training data into meta training data and meta testing data, and the basis of the division is different fields. Wherein training data originating from one part of the source domains is used as meta-training data and training data originating from another part of the source domains is used as meta-test data. It is actually the training data of one part of the source domain that is used to verify the model training effect on the other part of the source domain (i.e. the simulated target domain). For example, assume that there are training data for N source domains, with the training data for N1 source domains as meta-training data and the training data for the other N-N1 source domains as meta-test data. The selection of the n1 source domains can be random or selected according to a certain strategy.
If augmented training data is present, as shown in FIG. 3, D may be s The method is divided into two parts according to the field at random:
Figure BDA0003663764050000061
and
Figure BDA0003663764050000062
and, from the augmented data
Figure BDA0003663764050000063
In determining
Figure BDA0003663764050000064
Corresponding augmented data
Figure BDA0003663764050000065
Can be combined with
Figure BDA0003663764050000066
As meta-training data, will
Figure BDA0003663764050000067
As meta-test data.
Further, as shown in fig. 3, in order to introduce the supermodel of the convex game in the subsequent model training process, the league construction can be performed by using the meta-training data, and various data sets are generated: s, T, S ^ T. Wherein, S is a first data set formed by randomly selected training data from meta training data, T is a second data set formed by randomly selected training data from meta training data, ssut is a third data set formed by a union of the first data set and the second data set, and S ∞ T is a fourth data set formed by an intersection of the first data set and the second data set.
It should be noted that, the terms "first", "second", and the like in the embodiments of the present application are not limited in terms of size, order, number, and the like, and are merely used for distinguishing in terms of names, for example, the term "first data set" and the term "second data set" are used for two data sets.
The above-mentioned step 206, i.e., "training the cross-domain learning model using the meta-training data and the meta-testing data", is described in detail below with reference to the embodiments.
The cross-domain learning model involved in the embodiments of the present application may be various types of deep learning models, such as a classification model, a regression model, a ranking model, a time series prediction model, and so on. At the beginning of training, model parameters are initialized first, and as shown in fig. 3, the model may be represented as f (·, θ), where the model parameters θ are initialized.
Model training has mainly two training objectives:
the first training objective is: and the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game.
The second training target is: the output results of the cross-domain learning model for the meta-training data and the meta-testing data are in line with expectations.
First, how training is performed to achieve the first training goal described above is described.
The cross-domain learning model can be subjected to meta-training by respectively utilizing the first data set, the second data set, the third data set and the fourth data set to obtain a first model parameter, a second model parameter, a third model parameter and a fourth model parameter. And respectively obtaining a first loss function value, a second loss function value, a third loss function value and a fourth loss function value of the meta-test data corresponding to the first model parameter, the second model parameter, the third model parameter and the fourth model parameter. And updating the model parameters by using the first loss function value, the second loss function value, the third loss function value and the fourth loss function value to minimize a difference value obtained by subtracting the sum of the first loss function and the second loss function value from the sum of the third loss function value and the fourth loss function value.
In connection with fig. 3, four data sets may be utilized: s, T, Su T, S &' T respectively perform meta-training on the model f (·, θ), and taking the classification model as an example, a supervised classification loss function can be constructed first to update the model parameters of f (·, θ). The update is actually a false update, that is, the model parameters are not actually updated, but what the model parameters are updated after the model f (·, θ) is meta-trained respectively by using S, T, ssut, S ∞ T is obtained by using algorithm calculation, and the hypothesis is expressed as: theta' S 、θ' T 、θ' S∪T And θ' S∩T . Aiming at meta-test data on the basis of respective updated model parameters
Figure BDA0003663764050000071
Constructing supervised classification loss functions
Figure BDA0003663764050000072
And are each calculated at θ' S 、θ' T 、θ' S∪T And θ' S∩T Upper target meta test data
Figure BDA0003663764050000073
Obtained loss function value
Figure BDA0003663764050000074
And
Figure BDA0003663764050000075
as one preferred implementation mode, the domain generalization problem is formulated into a convex game problem among domains, the effectiveness of data information migration is ensured through the supermodel of the convex game, and the data information among the domains is more fully utilized.
According to the supermode definition of the convex game, the income obtained by the intersection of the two data sets is added with the income obtained by the union of the two data setsThe benefit needs to be no less than the sum of the gains obtained by the two data sets, so that better cooperation between the domains can be achieved. Based on the theory, a regular term loss function L can be constructed in the embodiment of the application sm
Figure BDA0003663764050000076
The first training objective can be seen as training the cross-domain learning model to minimize the regularized term loss function L sm Minimizing the above-mentioned regularized term loss function L sm In fact, the training data in each field is encouraged to make a contribution to improving the generalization performance of the model.
The following describes how training is performed to achieve the second training goal described above.
The second training objective is primarily to make the output result of the training data, including meta training data and meta test data, as expected. For supervised learning, the output result is expected to generally minimize the difference between the output result and the label in the corresponding training data. A loss function L can be constructed using the training target sup The loss function is mainly a supervised learning loss function and can be set according to different model types. Taking the classification model as an example, a Hingle loss function and a cross entropy loss function can be constructed. Taking a regression model as an example, a square loss function, an absolute loss function, a Huber loss function, and the like may be constructed.
But considering the sample pair regularization term loss function L in the training data sm The larger the contribution of (a), the more unfavorable the improvement of the model generalization performance, meaning the lower the sample quality. Therefore, as a preferred embodiment, the contribution score to the first training target in the training samples may be determined, and the training samples with the contribution scores meeting the preset low-quality score standard are deleted from the training samples, so as to obtain high-quality training samples; and updating the model parameters by using the obtained high-quality training samples to realize the second training target.
In the present application, the description is made with reference to FIG. 3In an embodiment, the product of the gradient of the training data and the feature representation of the training sample may be used to evaluate the contribution of the training data to the first training objective. The regularizing term loss function L may be computed first sm The gradient of sample x in the training data is expressed as
Figure BDA0003663764050000081
Then will be
Figure BDA0003663764050000082
And the contribution score of the training data corresponding to the sample x is obtained. The higher the score, the greater the negative impact of the training data on the model generalization performance, and the worse the quality. Sample filtering may be performed using contribution scores, e.g., training data
Figure BDA0003663764050000083
And deleting the training data with the contribution degree score larger than or equal to the preset score threshold value. And then for example, training data
Figure BDA0003663764050000084
Deleting the training data with the medium contribution score ranked at the top k, wherein k is a preset positive integer. The deleted training data is expressed as:
Figure BDA0003663764050000085
the training data after deletion was used as:
Figure BDA0003663764050000086
calculating a loss function L sup The second training objective can be thought of as training the cross-domain learning model to minimize L sup
Through the filtering to the low quality training sample, can avoid noise data and redundant data to the negative effects that cross-domain study brought, effectively guarantee cross-domain training data to the promotion of model generalization performance to learn more stable model.
In the above model training process, the first training target and the second training target can be regarded as two training targetsAnd (4) alternately training to update model parameters. The first training objective and the second training objective may also be considered as a whole training task, for example, constructing an overall loss function L ═ L sup +ωL sm The model parameters are updated to minimize L. Where ω is a preset weight value, and an empirical value may be used.
The model parameters can be updated in a gradient descent mode or other modes by utilizing the value of the loss function L in each iteration until a preset training end condition is met. The training end condition may include, for example, that a value of the loss function L is less than or equal to a preset loss function threshold, the number of iterations reaches a preset number threshold, and the like.
After the model training is completed through the process, a cross-domain learning model is obtained, and the cross-domain learning model can be used for analyzing and predicting input data of a target domain and outputting a prediction result. Wherein the target domain may be one of the source domains or may be a domain other than the source domain. That is, the trained model is not a domain-specific model and can only analyze and predict the input data of a specific domain, but is a cross-domain model. The method can have good prediction effect on the same task aiming at various fields, and has higher generalization performance.
Two application scenarios are mentioned here:
application scenario 1:
in an image recognition scene, image data in the fields of sketches, photos, cartoons and the like are relatively easy to acquire, and the data volume is large. Therefore, image data in the fields of sketch, photo, cartoon and the like can be obtained, after labels are marked on objects in the image data, the image data and the labels thereof are used as training data D s . To D s Fourier augmentation is carried out to obtain augmented data
Figure BDA0003663764050000087
Will D s The method is divided into two parts according to the field at random:
Figure BDA0003663764050000088
and
Figure BDA0003663764050000089
suppose that the image data of a sketch or a photograph is randomly used as
Figure BDA00036637640500000810
Taking cartoon image data as
Figure BDA00036637640500000811
After the model training is performed by adopting the method in the embodiment of the method, the obtained image recognition model not only can have better recognition capability (namely, the second training target) on the image data of the source domain, but also can have good cross-domain generalization performance, namely the sum of gains on the union and the intersection of the training data of each domain is greater than the sum of gains of the training data of each domain (namely, the first training target). That is, the trained image recognition model can not only accurately recognize images of image data in the fields of sketches, photographs and cartoons, but also accurately recognize images of image data in other fields such as silhouettes.
Application scenario 2:
in an information recommendation scenario, a large amount of user popularization data, such as user information and user-focused popularization data, in countries such as china, the united states, japan, and the like have been acquired. Therefore, it is possible to acquire user popularization data in countries such as China, the United states, Japan, and the like, form sample pairs such as "popularization data focused on by user-user", and use these sample pairs as training data D s . To D s Fourier amplification is carried out to obtain amplification data
Figure BDA0003663764050000091
Will D s The method is divided into two parts according to the field:
Figure BDA0003663764050000092
and
Figure BDA0003663764050000093
suppose that the user promotion data of China and the United states are taken as random
Figure BDA0003663764050000094
Take Japanese user promotion data as
Figure BDA0003663764050000095
After model training is performed by adopting the method in the embodiment of the method, the obtained information recommendation model not only has better information recommendation capability (namely, a second training target) for the user of the source domain, but also has good cross-domain generalization performance, namely, the sum of gains on the union and intersection of the training data of each domain is greater than the sum of gains of the training data of each domain (the second training target). That is, the trained information recommendation model can accurately recommend information not only to users in countries such as china, the united states, japan, etc., but also to users in countries of south-central asia such as vietnam, etc.
By using the method provided by the embodiment of the application under the application scene, the cross-domain learning of information can be performed between different countries, so that the basic semantic information of each country can be shared, and a model capable of supporting multi-country information recommendation is constructed, namely, the unified model learned in the cross-domain learning has better generalization performance, and has better prediction accuracy than the model learned respectively by using user popularization data of a single country.
The foregoing description of specific embodiments has been presented for purposes of illustration and description. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
According to an embodiment of another aspect, an apparatus for acquiring a cross-domain learning model is provided. FIG. 4 shows a schematic block diagram of an apparatus for obtaining a cross-domain learning model according to one embodiment. As shown in fig. 4, the apparatus 400 includes: the sample acquiring unit 401, the sample dividing unit 402, and the model training unit 403 may further include a sample augmenting unit 404, a federation constructing unit 405, and a sample filtering unit 406. The main functions of each constituent unit are as follows:
a sample acquisition unit 401 configured to acquire training data originating from a plurality of source domains.
A sample dividing unit 402 configured to use training data from one part of the source domains as meta-training data and use training data from another part of the source domains as meta-test data.
Wherein training data originating from one part of the source domains is used as meta-training data and training data originating from another part of the source domains is used as meta-test data. It is actually the training data of one part of the source domain that is used to verify the model training effect on the other part of the source domain (i.e. the simulated target domain).
A model training unit 403 configured to train a cross-domain learning model using meta training data and meta test data, the training targets including a first training target and a second training target; the first training objective is: the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game; the second training target is: the output results of the cross-domain learning model for the meta-training data and the meta-testing data are in line with expectations.
The cross-domain learning model involved in the embodiments of the present application may be a variety of deep learning models, such as a classification model, a regression model, a ranking model, a time series prediction model, and so on.
The cross-domain learning model obtained through training is used for analyzing and predicting input data from a target domain, and outputting a prediction result, wherein the target domain is one of a plurality of source domains or other domains except the source domains.
As one of the realizable approaches, the sample augmentation unit 404 is configured to: and respectively carrying out Fourier amplification on the training data from the plurality of source domains to obtain the training data of each source domain after the amplification.
Specifically, the sample amplification unit 404 may perform fourier transform on the training data to obtain an amplitude component and a phase component, then perform perturbation on the amplitude component to generate a new amplitude component, and perform inverse fourier transform on the phase component and the new amplitude component to obtain the amplification data.
Further, the federation construction unit 405 is configured to construct the first data set and the second data set using the meta-training data, and obtain an intersection of the first data set and the second data set as a third data set and obtain a union of the first data set and the second data set as a fourth data set.
Accordingly, the model training unit 403 is specifically configured to: performing meta-training on the cross-domain learning model by respectively utilizing the first data set, the second data set, the third data set and the fourth data set to obtain a first model parameter, a second model parameter, a third model parameter and a fourth model parameter; and respectively obtaining a first loss function value, a second loss function value, a third loss function value and a fourth loss function value of the meta-test data corresponding to the first model parameter, the second model parameter, the third model parameter and the fourth model parameter. The first training objective then comprises: a difference resulting from subtracting the sum of the first loss function and the second loss function value from the sum of the third loss function value and the fourth loss function value is minimized.
As one of the realizable ways, the second training goal includes:
and minimizing the difference between the output results of the cross-domain learning model for the samples in the meta-training data and the labels corresponding to the samples.
Still further, the sample filtering unit 406 may be configured to: determining a contribution score of the training data to a first training target; and deleting the training data with contribution degree scores meeting the preset low-quality score standard from the training data.
Accordingly, the model training unit 403 updates the model parameters with the training data obtained after the deleted processing to achieve the second training target.
As one of the realizable ways, the sample filtering unit 406 may be specifically configured to: determining a contribution score of the training sample to the first training target by utilizing a product of the gradient of the fifth loss function to the training sample and the feature representation of the training sample; wherein the fifth loss function is pre-constructed based on the first training objective.
It should be noted that, in the embodiments of the present application, the user data may be used, and in practical applications, the user-specific personal data may be used in the scheme described herein within the scope permitted by the applicable law, under the condition of meeting the requirements of the applicable law and regulations in the country (for example, the user explicitly agrees, the user is informed, etc.).
In addition, the present application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method described in any of the preceding method embodiments.
And an electronic device comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the steps of the method of any of the preceding method embodiments.
Fig. 5 exemplarily shows an architecture of an electronic device, and may specifically include a processor 510, a video display adapter 511, a disk drive 512, an input/output interface 513, a network interface 514, and a memory 520. The processor 510, the video display adapter 511, the disk drive 512, the input/output interface 513, the network interface 514, and the memory 520 may be communicatively connected by a communication bus 530.
The processor 510 may be implemented by a general-purpose CPU, a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute a relevant program to implement the technical solution provided in the present Application.
The Memory 520 may be implemented in the form of a ROM (Read Only Memory), a RAM (random access Memory), a static storage device, a dynamic storage device, or the like. The memory 520 may store an operating system 521 for controlling the operation of the electronic device 500, and a Basic Input Output System (BIOS)522 for controlling low-level operations of the electronic device 500. In addition, a web browser 523, a data storage management system 524, and a device 525 for acquiring the cross-domain learning model, etc. may also be stored. The device 525 for obtaining the cross-domain learning model may be an application program that implements the operations of the foregoing steps in this embodiment of the application. In summary, when the technical solution provided in the present application is implemented by software or firmware, the relevant program codes are stored in the memory 520 and called to be executed by the processor 510.
The input/output interface 513 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component within the device (not shown) or may be external to the device to provide corresponding functionality. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The network interface 514 is used for connecting a communication module (not shown in the figure) to realize communication interaction between the device and other devices. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 530 includes a path that transfers information between the various components of the device, such as processor 510, video display adapter 511, disk drive 512, input/output interface 513, network interface 514, and memory 520.
It should be noted that although the above-mentioned devices only show the processor 510, the video display adapter 511, the disk drive 512, the input/output interface 513, the network interface 514, the memory 520, the bus 530, etc., in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above-described apparatus may also include only the components necessary to implement the embodiments of the present application, and need not include all of the components shown in the figures.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The technical solutions provided by the present application are introduced in detail, and specific examples are applied in the description to explain the principles and embodiments of the present application, and the descriptions of the above examples are only used to help understanding the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, the specific implementation and the application range may be changed. In view of the above, the description should not be taken as limiting the application.

Claims (10)

1. A method of obtaining a cross-domain learning model, the method comprising:
acquiring training data from a plurality of source domains;
training data from one part of the source domains is used as meta-training data, and training data from another part of the source domains is used as meta-test data;
training the cross-domain learning model by using the meta-training data and the meta-test data, wherein training targets comprise a first training target and a second training target; the first training target is: the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game; the second training target is: the output results of the cross-domain learning model aiming at the meta-training data and the meta-testing data are in accordance with expectations;
the trained cross-domain learning model is used for analyzing and predicting input data from a target domain, and outputting a prediction result, wherein the target domain is one of the source domains or other domains except the source domains.
2. The method of claim 1, further comprising, prior to said using training data from one of the portions of source domains as meta-training data and training data from another of the portions of source domains as meta-test data:
and respectively carrying out Fourier amplification on the training data from the plurality of source domains to obtain the training data of each source domain after the amplification.
3. The method of claim 1, further comprising: constructing a first data set and a second data set by using the meta-training data, acquiring an intersection of the first data set and the second data set as a third data set, and acquiring a union of the first data set and the second data set as a fourth data set;
training the cross-domain learning model using the meta-training data and the meta-test data comprises: performing meta-training on the cross-domain learning model by respectively utilizing the first data set, the second data set, the third data set and the fourth data set to obtain a first model parameter, a second model parameter, a third model parameter and a fourth model parameter; respectively obtaining a first loss function value, a second loss function value, a third loss function value and a fourth loss function value corresponding to the first model parameter, the second model parameter, the third model parameter and the fourth model parameter of the meta-test data;
the first training target comprises: minimizing a difference obtained by subtracting the sum of the first loss function and the second loss function value from the sum of the third loss function value and the fourth loss function value.
4. The method of claim 1, 2 or 3, wherein the training comprises:
determining the value of the total loss function in each iteration, and updating the model parameters by using the value of the total loss function until the preset training end condition is met;
wherein the total loss function is obtained by performing a weighted summation on a fifth loss function and a sixth loss function, the fifth loss function is pre-constructed according to the first training objective, and the sixth loss function is pre-constructed according to the second training objective.
5. The method of claim 1, further comprising:
determining a contribution score of the training data to the first training objective;
deleting the training data with contribution degree scores meeting a preset low-quality score standard from the training data;
updating model parameters using the training data obtained after the deleted processing to achieve the second training objective.
6. The method of claim 5, wherein determining the contribution score of the training sample to the first training goal comprises:
determining a contribution score of a training sample to the first training target by using a product of a gradient of a fifth loss function to the training sample and a feature representation of the training sample; wherein the fifth loss function is pre-constructed according to the first training objective.
7. The method of any of claims 1 to 6, wherein the training data for the plurality of source domains comprises: the image recognition method comprises the following steps that images of multiple fields and classification labels thereof are obtained, and the cross-domain learning model is an image recognition model; or,
the training data for the plurality of source domains comprises: the cross-domain learning model is an information recommendation model.
8. An apparatus for obtaining a cross-domain learning model, the apparatus comprising:
a sample acquisition unit configured to acquire training data derived from a plurality of source domains;
a sample dividing unit configured to take training data derived from one part of the source domains as meta-training data and take training data derived from another part of the source domains as meta-test data;
a model training unit configured to train the cross-domain learning model using the meta training data and the meta test data, training objectives including a first training objective and a second training objective; the first training target is: the income of the cross-domain learning model obtained by training the meta-training data on the meta-test data accords with the supermodel of the convex game; the second training target is: the output results of the cross-domain learning model aiming at the meta training data and the meta testing data are in accordance with expectations;
the trained cross-domain learning model is used for analyzing and predicting input data from a target domain, and outputting a prediction result, wherein the target domain is one of the source domains or other domains except the source domains.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the steps of the method of any of claims 1 to 7.
CN202210581106.XA 2022-05-26 2022-05-26 Method and device for acquiring cross-domain learning model Pending CN115115901A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210581106.XA CN115115901A (en) 2022-05-26 2022-05-26 Method and device for acquiring cross-domain learning model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210581106.XA CN115115901A (en) 2022-05-26 2022-05-26 Method and device for acquiring cross-domain learning model

Publications (1)

Publication Number Publication Date
CN115115901A true CN115115901A (en) 2022-09-27

Family

ID=83325548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210581106.XA Pending CN115115901A (en) 2022-05-26 2022-05-26 Method and device for acquiring cross-domain learning model

Country Status (1)

Country Link
CN (1) CN115115901A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556149A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Resource pushing method, device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556149A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Resource pushing method, device, electronic equipment and storage medium
CN117556149B (en) * 2024-01-11 2024-03-26 腾讯科技(深圳)有限公司 Resource pushing method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111931062A (en) Training method and related device of information recommendation model
CN106973244A (en) Using it is Weakly supervised for image match somebody with somebody captions
CN109983455A (en) The diversified media research result on online social networks
CN111061946A (en) Scenario content recommendation method and device, electronic equipment and storage medium
CN113704531A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111401521B (en) Neural network model training method and device, and image recognition method and device
CN113366489A (en) Detecting augmented reality targets
US9129216B1 (en) System, method and apparatus for computer aided association of relevant images with text
TWI803243B (en) Method for expanding images, computer device and storage medium
WO2022028147A1 (en) Image classification model training method and apparatus, computer device, and storage medium
CN111126262A (en) Video highlight detection method and device based on graph neural network
CN112396091B (en) Social media image popularity prediction method, system, storage medium and application
CN113656660A (en) Cross-modal data matching method, device, equipment and medium
CN110807472A (en) Image recognition method and device, electronic equipment and storage medium
CN112508048A (en) Image description generation method and device
Sun et al. Deep blur detection network with boundary-aware multi-scale features
CN115115901A (en) Method and device for acquiring cross-domain learning model
CN110781835A (en) Data processing method and device, electronic equipment and storage medium
CN113822521A (en) Method and device for detecting quality of question library questions and storage medium
CN117290596A (en) Recommendation label generation method, device, equipment and medium for multi-mode data model
CN114863450B (en) Image processing method, device, electronic equipment and storage medium
CN115952317A (en) Video processing method, device, equipment, medium and program product
CN115017413A (en) Recommendation method and device, computing equipment and computer storage medium
CN113537398A (en) Color value evaluation model training method and component, and color value evaluation method and component
CN114298961A (en) Image processing method, device, equipment and storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240221

Address after: Room 303, 3rd Floor, Building 5, No. 699 Wangshang Road, Changhe Street, Binjiang District, Hangzhou City, Zhejiang Province, 310052

Applicant after: Hangzhou Alibaba Overseas Internet Industry Co.,Ltd.

Country or region after: China

Address before: Room 554, 5 / F, building 3, 969 Wenyi West Road, Wuchang Street, Yuhang District, Hangzhou City, Zhejiang Province

Applicant before: Alibaba (China) Co.,Ltd.

Country or region before: China