A model training method and related device
The new features of the training samples are generated through the generative adversarial network and the samples with high similarity to the target set are selected as the training samples, which solves the problem of large deviations in the training samples and improves the effect of the model.
Patent Information
- Application Number
- CN201910593033.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-01
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2039-07-01
AI Technical Summary
The prior art has a large randomness when selecting training samples, which leads to bias in training samples, which leads to failure in modeling of models.
By obtaining the training set and the target set, input a generative adversarial network, generating new features of the training set, and computing the similarity between the training set and the target set based on the new features, selecting a training set with similarity exceeding the preset threshold to cooperate to train the training sample for model.
The bias of the training samples is reduced, the effect of the model is improved, and the training samples are closer to the data distribution of the target set.
Smart Images

Figure CN110288097B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model training method and related devices. Background Art
[0002] In computer software, it is a common way to build a model and then use it to implement computer functions. The establishment of an algorithm model usually involves selecting training samples, then training the model based on the training samples, and the trained model can be used to implement some functions.
[0003] When selecting training samples, data from a certain period of time is usually selected as the training source data, or data from a certain region is selected as the training source data, or data from certain nodes is selected as the training source data, and so on. Then the training source data is sampled to obtain training samples, and the sampling method can be random sampling, up-sampling, or other methods.
[0004] The above method of selecting training samples is highly random, and the training samples are prone to large deviations, resulting in deviation problems in the final model. Summary of the invention
[0005] The embodiments of the present application provide a model training method and related devices for solving the technical problem of modeling failure caused by large deviation of training samples.
[0006] In view of this, a first aspect of an embodiment of the present application provides a model training method, comprising:
[0007] Acquire a training set and a target set, wherein the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0008] Inputting the training set and the target set into a generative adversarial network, and generating new features of the training set through the generative adversarial network;
[0009] Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample;
[0010] The training samples are used to perform model training.
[0011] A second aspect of an embodiment of the present application provides a model training device, including:
[0012] An acquisition unit, configured to acquire a training set and a target set, wherein the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0013] A processing unit, configured to input the training set and the target set into a generative adversarial network, and generate new features of the training set through the generative adversarial network;
[0014] The processing unit is further used to calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first threshold as a training sample;
[0015] A training unit is used to perform model training using the training samples.
[0016] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the generative adversarial network includes a generator, a first discriminator, and a second discriminator;
[0017] The processing unit also receives the training set and the target set through the generator to generate the new feature;
[0018] The processing unit also outputs the training set and the target set having the new features through the generator;
[0019] The processing unit further distinguishes positive samples and negative samples of the training set output by the generator through the first discriminator;
[0020] The processing unit also distinguishes the training set and the target set output by the generator through the second discriminator.
[0021] In a possible design, in an implementation of the second aspect of the embodiments of the present application,
[0022] The processing unit is further configured to receive the training set, the target set, a first label and a second label through the generator, wherein the first label is used to distinguish the training set from the target set, and the second label is used to distinguish the positive sample from the negative sample of the training set;
[0023] The processing unit is also used to update the parameters of the generator and the parameters of the first discriminator with the goal of minimizing the output of the overall loss function;
[0024] The processing unit is also used to generate the new feature through the generator with updated parameters.
[0025] In a possible design, in an implementation of the second aspect of the embodiments of the present application,
[0026] The processing unit is further configured to receive the training set, the target set and the first label output by the generator through the second discriminator;
[0027] The processing unit is further used to update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function;
[0028] The processing unit is also used to distinguish the training set and the target set output by the generator through the second discriminator after parameter update.
[0029] In a possible design, in an implementation of the second aspect of the embodiments of the present application,
[0030] The processing unit is further configured to generate a first new feature through the generator according to the training set and the target set;
[0031] The processing unit is further used to calculate the accuracy of the second discriminator according to the training set and the target set having the first new feature;
[0032] The processing unit is further configured to output the first new feature if the accuracy of the second discriminator is less than a second preset threshold;
[0033] The processing unit is further configured to generate a second new feature through the generator according to the training set and the target set if the accuracy of the second discriminator is not less than a second preset threshold.
[0034] In a possible design, in an implementation of the second aspect of the embodiments of the present application,
[0035] The processing unit is further configured to generate a first new feature corresponding to a first number of iterations through the generator according to the training set and the target set;
[0036] The processing unit is further configured to output the first new feature if the first iteration number reaches a third preset threshold;
[0037] The processing unit is also used to generate a second new feature corresponding to a second number of iterations through the generator according to the training set and the target set if the first number of iterations does not reach a third preset threshold.
[0038] In a possible design, in an implementation of the second aspect of the embodiments of the present application,
[0039] The processing unit is further configured to generate a first new feature through the generator according to the training set and the target set;
[0040] The processing unit is also used to calculate the parameter change value of the generator;
[0041] The processing unit is further configured to output the first new feature if the parameter change value of the generator is less than a fourth preset threshold;
[0042] The processing unit is also used to generate a second new feature through the generator according to the training set and the target set if the parameter change value of the generator is not less than a fourth preset threshold.
[0043] A third aspect of an embodiment of the present application provides a server, including: a memory, a transceiver, a processor, and a bus system;
[0044] Wherein, the memory is used to store programs;
[0045] The processor is used to execute the program in the memory, comprising the following steps:
[0046] Acquire a training set and a target set, wherein the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0047] Inputting the training set and the target set into a generative adversarial network, and generating new features of the training set through the generative adversarial network;
[0048] Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first threshold as a training sample;
[0049] Using the training samples to perform model training;
[0050] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
[0051] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute the method of the first aspect.
[0052] A fifth aspect of an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer or a processor, enables the computer or the processor to execute the method of the first aspect.
[0053] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0054] The embodiment of the present application calculates new features of the training set and the target set so that the data samples of the training set are closer to the predicted data distribution of the target set. Finally, the training set with high similarity to the target set is selected as the training sample, and the model is trained through the training sample, which reduces the deviation of the training sample and improves the model effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is an application architecture diagram in the embodiment of this application;
[0056] Figure 2 A flow chart of a model training method provided in an embodiment of the present application;
[0057] Figure 3 A schematic diagram of an adversarial network in an embodiment of the present application;
[0058] Figure 4 A flowchart of an embodiment of a method for model training in an embodiment of the present application;
[0059] Figure 5 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application;
[0060] Figure 6 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application;
[0061] Figure 7 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application;
[0062] Figure 8 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application;
[0063] Fig. 9 A schematic diagram of a model training device in an embodiment of the present application;
[0064] Fig.10 A schematic diagram of a server structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The embodiments of the present application provide a model training method and related devices for solving the technical problem of modeling failure caused by large deviation of training samples.
[0066] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0067] It is understandable that using training samples to train models is a common method in the field of computer software. Training samples are generally sampled, such as random sampling and up and down sampling. However, this sampling method assumes that the training samples are distributed in the same way as the prediction samples, and cannot solve the modeling bias problem caused by inconsistent sample distribution. Therefore, in an embodiment of the present application, the sample selection model is optimized by sample confrontation (confrontation between samples that are consistent with the distribution of the prediction set and samples that are inconsistent with the distribution of the prediction set). The selected samples are made to tend to the sample distribution of the prediction set to a large extent, avoiding modeling bias.
[0068] Figure 1 This is an application architecture diagram in the embodiment of the present application. It should be understood that the embodiment of the present application can be applied to a server or a terminal. It can be that the server obtains the training sample and then trains the model, and sends the trained model to the terminal device so that the terminal device performs operations according to the model; it can also be that the server obtains the training sample and then trains the model, and then the server performs operations through the trained model; it can also be that the terminal obtains the training sample and then trains the model, and then the terminal device performs operations through the trained model. In practical applications, there can also be other ways, such as the first server obtains the training sample and then trains the model and sends the trained model to the second server so that the second server performs operations according to the model, which is not specifically limited here. Among them, the terminal device includes but is not limited to laptops, tablet computers, mobile phones, PDAs and vehicle terminal devices. A client is installed on the terminal device, and the terminal device implements the functions of the terminal device through the client. The client may include but is not limited to application software, underlying frameworks, operating systems, applications and cloud clients.
[0069] For example, if the server performs image recognition, it needs to train the image recognition model. It can be that the client sends an image to the server, and the server determines the type of image sent by the client based on the trained image recognition model, and then returns the result to the client. First, the server needs to select training samples to train the image recognition model. Images can be obtained from the database as training samples, and then the image recognition model is trained. The obtained training samples can be sampled or otherwise processed to achieve better training results. The embodiment of the present application provides a method for model training such as Figure 2 As stated, Figure 2 A flow chart of a model training method provided in an embodiment of the present application, the method comprising:
[0070] 201. Obtain a training set and a target set;
[0071] In an embodiment of the present application, a training set Xs and a target set Xt are first obtained, and the training set Xs and the target set Xt are mixed and input into a generative adversarial network.
[0072] Each sample in the target set Xt has a feature form of x = [x1, x2, x3, ... xn], where n is the total number of features, and the training set Xs and the target set Xt have the same feature form. When a new feature is generated by the generator and the training set Xs and the target set Xt with the new feature are output, the training set Xs and the target set Xt also have the same feature form.
[0073] In the embodiment of the present application, the training set Xs includes a second label 1 / 0, which is used to represent a positive sample or a negative sample.
[0074] It can be understood that the training set Xs and the target set Xt are mixed to generate a first label 1 / 0, which is used to indicate whether the sample belongs to the training set Xs or the target set Xt.
[0075] 202. Constructing adversarial networks;
[0076] Figure 3 For a schematic diagram of the adversarial network in the embodiment of the present application, please refer to Figure 3 , the adversarial network includes a generator, a first discriminator and a second discriminator;
[0077] The adversarial network receives the training set and the target set through the generator and generates the new feature;
[0078] The adversarial network outputs the training set and the target set having the new features through the generator;
[0079] The adversarial network distinguishes positive samples and negative samples of the training set output by the generator through the first discriminator;
[0080] The adversarial network distinguishes the training set and the target set output by the generator through the second discriminator.
[0081] It should be noted that the adversarial network divides the data source into source domain and target domain. The source domain corresponds to the training set, and the target domain corresponds to the target set. The input data is a mixture of source domain and target domain, where the source domain data has labels y and d, and the target domain has a label d (where the second label y is used to distinguish between positive and negative samples in the source domain, and d is used to distinguish between the source domain and the target domain).
[0082] 203. Train the generator and discriminator until they are stable;
[0083] The loss of the first discriminator can be expressed by the first loss function, which is:
[0084]
[0085] The loss of the second discriminator can be expressed by the second loss function, which is:
[0086]
[0087] The overall loss function is:
[0088]
[0089] In the embodiment of the present application, the generator, the first discriminator and the second discriminator can be trained according to the above loss function;
[0090] The process of training the generator and the first discriminator is to fix the parameters of the second discriminator, update the parameters of the generator and the first discriminator, and calculate the updated parameters of the generator and the first discriminator through the first training formula:
[0091]
[0092] The process of training the second discriminator is to fix the parameters of the generator and the first discriminator (generally the updated parameters), and update the parameters of the second discriminator. Specifically, the updated parameters of the second discriminator are calculated by the second training formula:
[0093]
[0094] The process of training the generator and discriminator (including the first discriminator and the second discriminator) until stability is:
[0095] 1. Train the second discriminator so that it can better distinguish the training set and the target set;
[0096] 2. Train the generator and the first discriminator. The generator generates new features so that the second discriminator cannot distinguish between the training set and the target set with the new features.
[0097] 3. Through continuous iteration of steps 1 and 2, the generator can generate new features that are good enough so that the distribution of the training set and the target set in the new feature space is consistent (ordinary classifiers cannot distinguish them), and the adversarial network is stable.
[0098] 204. Using the new features generated by the generator, the model selects samples that are closer to the target set;
[0099] In an embodiment of the present application, the new features of the trained generator make the training set and the target set relatively similar in the new feature space. Then, a machine learning model can be established and then the training set can be scored to determine the similarity between the training set and the target set, and the part with higher similarity can be selected as a sample.
[0100] 205. Use samples that are closer to the target set to train the model and make predictions.
[0101] In the embodiment of the present application, after selecting the sample, the model can be trained using the sample, and then the trained model is used for prediction. The embodiment of the present application uses samples that are closer to the target set to train the model, and the trained model can reduce the deviation and has a better model effect.
[0102] The above is a detailed description of a model training method in an embodiment of the present application. The following is a detailed description of an embodiment of a model training method in an embodiment of the present application.
[0103] Figure 4 This is a flowchart of an embodiment of a method for model training in an embodiment of the present application. Please refer to Figure 4 , an embodiment of a model training method in an embodiment of the present application comprises the following steps:
[0104] 401. Obtain a training set and a target set, where the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0105] In an embodiment of the present application, a training set is extracted from data and includes at least one data sample. A data sample may include at least one data parameter. The training set is extracted based on the samples required by the trained model. For example, for an image recognition model, the training set may select images from an image database as data samples, and each data sample includes parameters such as the color value of a pixel. In practical applications, there are other situations, such as a user login time prediction model. The training set may be a user login time selected from a user database as a data sample, and each data sample may include data such as user ID, user login time, and user offline time.
[0106] Similarly, the target set also includes at least one predicted data distribution sample, and a predicted data distribution sample includes at least one data parameter. The difference is that the target set is a pre-set predicted data distribution sample set, which can be a manually screened data distribution sample set, a predicted data distribution sample obtained by a prediction algorithm, or a predicted data distribution sample virtually synthesized by an algorithm. The source of the predicted data distribution sample set is not specifically limited here.
[0107] In an embodiment of the present application, the data parameter features included in the data samples of the training set and the predicted data distribution samples of the target set have the same feature form, and the data samples and the predicted data distribution samples have the same feature form of x = [x1, x2, x3, ... xn], where n is the total number of features, and x1, x2, x3, ... xn are data parameters. The training set and the target set have the same feature form. For example, if the target set has three data parameters, its feature form is x = [x1, x2, x3]. When acquiring data samples, the data samples of the training set composed of these three data parameters are acquired, and its feature form is also x = [x1, x2, x3].
[0108] In some optional embodiments, the training set and the target set carry a first label d, and the first label d is used to distinguish the training set from the target set, that is, to distinguish data samples from predicted data distribution samples. For example, the first label d attached to the training set is 0, and the first label d attached to the target set is 1. The value of the first label d can be used to determine which set the samples in the training set and the target set belong to. In practical applications, the first label d attached to the training set can also be 1, and the first label d attached to the target set can be 0, which is not specifically limited here.
[0109] In some optional embodiments, the target set may have the first label d, while the training set may not have the first label d. Then, whether the sample has the first label d can be used to determine whether the sample belongs to the training set or the target set. In practical applications, the target set may not have the first label d, while the training set may have the first label d. The specifics are not limited here.
[0110] In some optional embodiments, the training set also carries a second label y, and the second label y is used to distinguish positive samples from negative samples in the training set. For example, if the second label y of a data sample in the training set is 1, it indicates that the data sample is a positive sample, and if the second label y of a data sample in the training set is 0, it indicates that the data sample is a negative sample. In practical applications, it is also possible that the second label y of a data sample in the training set is 0 to indicate that the data sample is a positive sample, and the second label y of a data sample in the training set is 1 to indicate that the data sample is a negative sample, and the specifics are not limited here.
[0111] 402. Input the training set and the target set into a generative adversarial network, and generate new features of the training set through the generative adversarial network;
[0112] The training set and the target set are input into the generative adversarial network, specifically, the data samples in the training set and the predicted data distribution samples in the target set are mixed and then input into the generative adversarial network. In computer software, the generative adversarial network can receive the training set and the target set.
[0113] Generative Adversarial Networks (GAN) is a deep learning model that can generate samples with new features based on samples. Generative Adversarial Networks can include a generator (Generative Model) and a discriminator (Discriminative Model). Through the game learning between the generator and the discriminator, the generator outputs better samples with new features, that is, data samples with new features and predicted data distribution samples with new features.
[0114] In an embodiment of the present application, the generative adversarial network outputs data samples with new features and predicted data distribution samples with new features, that is, new features of the training set and the target set. For example, the original features of the training set and the target set are x = [x1, x2, x3, ... xn], where n is the total number of original features. After the generative adversarial network outputs data samples with new features, the new features of the training set and the target set can be obtained as f(x) = [x1, x2, x3, ... xm], where m is the total number of new features.
[0115] 403. Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample;
[0116] In an embodiment of the present application, all data samples with the new feature can be obtained according to the new feature f(x) = [x1, x2, x3, ... xm]. For example, the data samples of the training set are input into the generator to obtain the data samples with the new feature, and the predicted data distribution samples of the target set are input into the generator to obtain the predicted data distribution samples with the new feature. In some optional embodiments, it can be determined by the label whether the sample belongs to the training set or the target set.
[0117] Then, the similarity between the training set and the target set is calculated by constructing a machine learning model, which can be achieved by calculating the similarity between the data samples of the training set and the target set, or by directly calculating, which is not specifically limited here. The machine learning model can be an algorithm or model for calculating similarity, such as a vector space model (Vector Space Model), a neural network model, etc., which is not specifically limited here.
[0118] In the embodiment of the present application, after the similarity is calculated, generally, the higher the similarity, the more similar the training set is to the target set. If the similarity exceeds the first preset threshold, it means that the training set under the new feature is close to the target set and can be used as a training sample. In some optional embodiments, the similarity between the data samples of the training set and the target set can also be calculated separately, and then the data samples of the training set whose similarity exceeds the first preset threshold are selected as training samples.
[0119] 404. Use training samples to train the model.
[0120] In the embodiment of the present application, after selecting the training samples, the selected training samples can be used for model training. The embodiment of the present application does not specifically limit the training model, which can be a neural network model, a decision tree model, etc. The embodiment of the present application does not specifically limit the training method.
[0121] Using training samples that are similar to the predicted data distribution samples of the target set in the embodiment of the present application for model training can avoid modeling deviation and improve the model training effect.
[0122] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, the embodiment of the present application also provides an optional embodiment of the method for model training, such as Figure 5 As shown, Figure 5 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application, the method comprising:
[0123] 501. Obtain a training set and a target set, where the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0124] In the embodiment of the present application, step 501 is similar to the above Figure 4 Step 401 in the illustrated embodiment is similar and will not be described again here.
[0125] 502. Input the training set and the target set into the generative adversarial network;
[0126] In the embodiment of the present application, step 502 is similar to the above Figure 4 In the illustrated embodiment, inputting the training set and the target set into the generative adversarial network in step 402 is similar and will not be repeated here.
[0127] 503. Update the parameters of the generator, the first discriminator, and the second discriminator through game learning of the generator, the first discriminator, and the second discriminator of the generative adversarial network;
[0128] In the embodiment of the present application, the generator outputs a training set and a target set with new features, the first discriminator distinguishes the positive samples and negative samples of the training set output by the generator, and the second discriminator distinguishes the training set and the target set output by the generator;
[0129] The game learning process of the generator, the first discriminator and the second discriminator of the generative adversarial network can be a cyclic training process of the generator, the first discriminator and the second discriminator. The parameters of the generator, the first discriminator and the second discriminator are continuously updated through alternating training of the generator, the first discriminator and the second discriminator, so that the parameters of the generator, the first discriminator and the second discriminator tend to be stable, thereby obtaining updated parameters of the generator, the first discriminator and the second discriminator.
[0130] 504. Generate new features of the training set through the generator with updated parameters;
[0131] In an embodiment of the present application, the generator after parameter update can generate new features so that the training set and the target set have a new feature space, and the new features of the training set are the new features of the target set. For example, the new features generated by the generator after parameter update are f(x) = [x1, x2, x3, ... xm], then the feature space of the training set is f(x) = [x1, x2, x3, ... xm], and the feature space of the target set is also f(x) = [x1, x2, x3, ... xm].
[0132] 505. Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample;
[0133] In the present embodiment, step 505 is similar to the above Figure 4 Step 403 in the illustrated embodiment is similar and will not be described again here.
[0134] 506. Use training samples to train the model.
[0135] In the embodiment of the present application, step 506 is similar to the above Figure 4 Step 404 in the illustrated embodiment is similar and will not be described in detail here.
[0136] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, the embodiment of the present application also provides an optional embodiment of the method for model training, such as Figure 6 As shown, Figure 6 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application, the method comprising:
[0137] 601. Acquire a training set and a target set, where the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0138] In the embodiment of the present application, step 601 is similar to the above Figure 4 Step 401 in the illustrated embodiment is similar and will not be described again here.
[0139] 602. Input the training set and the target set into a generative adversarial network;
[0140] In the present embodiment, step 602 is similar to the above Figure 5 Step 502 in the illustrated embodiment is similar and will not be described in detail here.
[0141] 603. Receive a training set, a target set, a first label, and a second label through a generator, wherein the first label is used to distinguish between the training set and the target set, and the second label is used to distinguish between positive samples and negative samples in the training set;
[0142] In the embodiment of the present application, the first label is label d, and the second label is label y. When the generator receives the training set and the target set, it simultaneously receives the first label and the second label of the training set and the target set. Alternatively, the generator generates the first label, that is, the generator generates the first label for distinguishing the training set from the target set.
[0143] 604. Update the parameters of the generator and the parameters of the first discriminator with the goal of minimizing the output of the overall loss function;
[0144] It can be understood that, according to the overall loss function and the first training formula, the embodiment of the present application can update the parameters of the generator and the parameters of the first discriminator with the goal of minimizing the output of the overall loss function. When updating, the parameters of the second discriminator used in the first update are the initial values of the parameters of the second discriminator, and the parameters of the second discriminator used in the second and subsequent updates are the updated parameters of the second discriminator.
[0145] 605. Generate and output a training set and a target set with new features and new features through the generator with updated parameters;
[0146] In an embodiment of the present application, the generator after parameter update can output new features as well as a training set and a target set with the new features.
[0147] 606. Receive the training set, the target set, and the first label output by the generator through the second discriminator;
[0148] In an embodiment of the present application, the training set output by the generator and the target set are the training set and the target set of the new features. Each time the generative training updates the parameters, the training set and the target set output by the generator are updated accordingly, making it more difficult for the second discriminator to distinguish between the training set and the target set. The second discriminator also receives a first label, and the first label is used to determine whether the second discriminator can distinguish between the training set and the target set.
[0149] 607. Update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function;
[0150] It is understandable that, according to the overall loss function and the second training formula, the embodiment of the present application can update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function. The generator parameters and the first discriminator parameters used during the update are the updated parameters.
[0151] 608. Distinguish the training set and the target set output by the generator through the second discriminator with updated parameters;
[0152] In the embodiment of the present application, after the parameters are updated, the second discriminator has a stronger discrimination ability and can better distinguish the training set and the target set output by the generator. Specifically, the second discriminator can be a neural network model, which can be set to input a sample, and output 1 to judge it as a training set, and output 0 to judge it as a target set. In practical applications, other models and other settings can also be used, which are not limited here.
[0153] 609. If the accuracy of the second discriminator is less than the second preset threshold, output the new feature through the generator; if the accuracy of the second discriminator is not less than the second preset threshold, return to execute step 604;
[0154] It can be understood that if the second discriminator determines that a sample belongs to the training set and the first label indicates that the sample belongs to the training set, then the second discriminator accurately discriminates a sample; if the second discriminator determines that a sample belongs to the training set and the first label indicates that the sample belongs to the target set or the second discriminator determines that a sample belongs to the target set and the first label indicates that the sample belongs to the target set, then the second discriminator incorrectly discriminates a sample, and the number of samples correctly discriminated by the second discriminator divided by the total number of samples is the accuracy of the second discriminator.
[0155] After obtaining the accuracy of the second discriminator, it can be determined whether the accuracy of the second discriminator is less than the second threshold. If so, it means that the accuracy of the second discriminator is low, and the second discriminator cannot distinguish the training set and the target set well. The training set and the target set are distributed more consistently in the new feature space, and the generator outputs the training set and the target set with new features.
[0156] If the accuracy of the second discriminator is not less than the second preset threshold, the next round of training is started to update the parameters.
[0157] 610. Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample;
[0158] In the embodiment of the present application, step 610 is similar to the above Figure 4 Step 403 in the illustrated embodiment is similar and will not be described again here.
[0159] 611. Use training samples to train the model.
[0160] In the embodiment of the present application, step 611 is similar to the above Figure 4 Step 404 in the illustrated embodiment is similar and will not be described in detail here.
[0161] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, the embodiment of the present application also provides an optional embodiment of the method for model training, such as Figure 7 As shown, Figure 7 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application, the method comprising:
[0162] 701. Obtain a training set and a target set, where the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0163] In the embodiment of the present application, step 701 is similar to the above Figure 4 Step 401 in the illustrated embodiment is similar and will not be described again here.
[0164] 702. Input the training set and the target set into a generative adversarial network;
[0165] In the embodiment of the present application, step 702 is similar to the above Figure 5 Step 502 in the illustrated embodiment is similar and will not be described in detail here.
[0166] 703. Receive a training set, a target set, a first label, and a second label through a generator, wherein the first label is used to distinguish between the training set and the target set, and the second label is used to distinguish between positive samples and negative samples in the training set;
[0167] In the embodiment of the present application, step 703 is similar to the aforementioned Figure 6 Step 603 in the illustrated embodiment is similar and will not be described again here.
[0168] 704. Update the parameters of the generator and the first discriminator with the goal of minimizing the output of the overall loss function;
[0169] In the present embodiment, step 704 is similar to the above Figure 6 Step 604 in the illustrated embodiment is similar and will not be described again here.
[0170] 705. Generate and output a training set and a target set with new features and new features through the generator with updated parameters;
[0171] In the present embodiment, step 705 is similar to the above Figure 6 Step 605 in the illustrated embodiment is similar and will not be described in detail here.
[0172] 706. Receive the training set, the target set, and the first label output by the generator through the second discriminator;
[0173] In the present embodiment, step 706 is similar to the above Figure 6 Step 606 in the illustrated embodiment is similar and will not be described again here.
[0174] 707. Update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function;
[0175] In the present embodiment, step 707 is similar to the above Figure 6 Step 607 in the illustrated embodiment is similar and will not be described again here.
[0176] 708. Distinguish the training set and the target set output by the generator through the second discriminator with updated parameters.
[0177] In the embodiment of the present application, step 708 is similar to the above Figure 6 Step 608 in the illustrated embodiment is similar and will not be described again here.
[0178] 709. The number of iterations is increased by one. If the number of iterations reaches a third preset threshold, the new feature is output through the generator; if the number of iterations does not reach the third preset threshold, the process returns to step 704.
[0179] In the embodiment of the present application, the initial value of the number of iterations can be 0. After a round of training to update the parameters, the number of iterations is increased by one, indicating that one iteration has been performed. After several iterations, the generator, the first discriminator, and the second discriminator have all been improved. When the preset number of iterations (the third preset threshold) is reached, it is considered that the generator, the first discriminator, and the second discriminator have reached stability, and the distribution of the training set and the target set in the new feature space is relatively consistent. The generator outputs the training set and the target set with new features.
[0180] If the preset number of iterations is not reached, it means that more iterations are needed, and the process returns to the previous step to perform the next round of training and update the parameters.
[0181] 710. Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample;
[0182] In the embodiment of the present application, step 710 is similar to the above Figure 4 Step 403 in the illustrated embodiment is similar and will not be described again here.
[0183] 711. Use training samples to train the model.
[0184] In the embodiment of the present application, step 711 is similar to the aforementioned Figure 4 Step 404 in the illustrated embodiment is similar and will not be described in detail here.
[0185] Optionally, in the above Figure 4 On the basis of the corresponding embodiments, the embodiment of the present application also provides an optional embodiment of the method for model training, such as Figure 8 As shown, Figure 8 A flowchart of an optional embodiment of the method for model training provided in an embodiment of the present application, the method comprising:
[0186] 801. Acquire a training set and a target set, where the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0187] In the embodiment of the present application, step 801 is similar to the above Figure 4 Step 401 in the illustrated embodiment is similar and will not be described again here.
[0188] 802. Input the training set and the target set into a generative adversarial network;
[0189] In the embodiment of the present application, step 802 is similar to the above Figure 5 Step 502 in the illustrated embodiment is similar and will not be described in detail here.
[0190] 803. Receive a training set, a target set, a first label, and a second label through a generator, wherein the first label is used to distinguish between the training set and the target set, and the second label is used to distinguish between positive samples and negative samples in the training set;
[0191] In the embodiment of the present application, step 803 is similar to the above Figure 6 Step 603 in the illustrated embodiment is similar and will not be described again here.
[0192] 804. Update the parameters of the generator and the first discriminator with the goal of minimizing the output of the overall loss function;
[0193] In the present embodiment, step 804 is similar to the above Figure 6 Step 604 in the illustrated embodiment is similar and will not be described again here.
[0194] 805. Generate and output a training set and a target set with new features and the new features through the generator with updated parameters;
[0195] In the present embodiment, step 805 is similar to the above Figure 6 Step 605 in the illustrated embodiment is similar and will not be described in detail here.
[0196] 806. Receive the training set, the target set, and the first label output by the generator through the second discriminator;
[0197] In the present embodiment, step 806 is similar to the above Figure 6 Step 606 in the illustrated embodiment is similar and will not be described again here.
[0198] 807. Update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function;
[0199] In the present embodiment, step 807 is similar to the above Figure 6 Step 607 in the illustrated embodiment is similar and will not be described again here.
[0200] 808. Distinguish the training set and the target set output by the generator through the second discriminator with updated parameters.
[0201] In the present embodiment, step 808 is similar to the above Figure 6 Step 608 in the illustrated embodiment is similar and will not be described again here.
[0202] 809. If the parameter change value of the generator is less than the fourth preset threshold, the new feature is output through the generator. If the parameter change value of the generator is not less than the fourth preset threshold, return to execute step 804.
[0203] In an embodiment of the present application, the generator parameters will change each time they are updated, and the difference between the values of the updated parameters and the values of the parameters before the update can be the parameter change value of the generator, which is used to illustrate the changes before and after the generator parameters are updated.
[0204] In an embodiment of the present application, if the parameter change value of the generator is less than the fourth preset threshold, it means that the generator has become stable, the new features it generates also change less, the training set and the target set are distributed more consistently in the new feature space, and the generator outputs a training set and a target set with new features.
[0205] If the parameter change value of the generator is not less than the fourth preset threshold, it means that the generator is still performing large-scale parameter updates, and the feature space of the training set and the target set needs to be significantly changed to make it more difficult for the second discriminator to distinguish between the training set and the target set. Therefore, it is necessary to continue to update the training parameters, so return to the previous steps to update the parameters.
[0206] 810. Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample;
[0207] In the embodiment of the present application, step 810 is similar to the above Figure 4 Step 403 in the illustrated embodiment is similar and will not be described again here.
[0208] 811. Use training samples to train the model.
[0209] In the embodiment of the present application, step 811 is similar to the above Figure 4 Step 404 in the illustrated embodiment is similar and will not be described in detail here.
[0210] The following is a detailed description of a model training device in an embodiment of the present application.
[0211] Fig. 9 This is a schematic diagram of a model training device in an embodiment of the present application, please refer to Fig. 9 , a model training device in an embodiment of the present application, specifically a server 900, includes:
[0212] An acquisition unit 901 is used to acquire a training set and a target set, where the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0213] A processing unit 902 is used to input the training set and the target set into a generative adversarial network, and generate new features of the training set through the generative adversarial network;
[0214] The processing unit 902 is further configured to calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first threshold as a training sample;
[0215] The training unit 903 is used to perform model training using training samples.
[0216] Optionally, in the above Fig. 9 On the basis of the corresponding embodiments, in an optional embodiment of the model training device provided in the embodiment of the present application, the generative adversarial network includes a generator, a first discriminator and a second discriminator;
[0217] The processing unit 902 also receives the training set and the target set through the generator to generate new features;
[0218] The processing unit 902 also outputs the training set and the target set having the new features through the generator;
[0219] The processing unit 902 further distinguishes the positive samples and negative samples of the training set output by the generator through the first discriminator;
[0220] The processing unit 902 also distinguishes between the training set and the target set output by the generator through a second discriminator.
[0221] Optionally, in the above Fig. 9 On the basis of the corresponding embodiments, in an optional embodiment of the device for model training provided in the embodiments of the present application,
[0222] The processing unit 902 is further configured to receive a training set, a target set, a first label, and a second label through a generator, wherein the first label is used to distinguish between the training set and the target set, and the second label is used to distinguish between positive samples and negative samples in the training set;
[0223] The processing unit 902 is further configured to update the parameters of the generator and the parameters of the first discriminator with the goal of minimizing the output of the overall loss function;
[0224] The processing unit 902 is further configured to generate new features through the generator with updated parameters.
[0225] Optionally, in the above Fig. 9 On the basis of the corresponding embodiments, in an optional embodiment of the model training device provided in the embodiments of the present application,
[0226] The processing unit 902 is further configured to receive the training set, the target set and the first label output by the generator through the second discriminator;
[0227] The processing unit 902 is further configured to update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function;
[0228] The processing unit 902 is also used to distinguish the training set and the target set output by the generator through the second discriminator after parameter update.
[0229] Optionally, in the above Fig. 9 On the basis of the corresponding embodiments, in an optional embodiment of the model training device provided in the embodiments of the present application,
[0230] The processing unit 902 is further configured to generate a first new feature through a generator according to the training set and the target set;
[0231] The processing unit 902 is further configured to calculate the accuracy of the second discriminator according to the training set and the target set having the first new feature;
[0232] The processing unit 902 is further configured to output the first new feature if the accuracy of the second discriminator is less than a second preset threshold;
[0233] The processing unit 902 is further configured to generate a second new feature through a generator according to the training set and the target set if the accuracy of the second discriminator is not less than a second preset threshold.
[0234] Optionally, in the above Fig. 9 On the basis of the corresponding embodiments, in an optional embodiment of the device for model training provided in the embodiments of the present application,
[0235] The processing unit 902 is further configured to generate a first new feature corresponding to a first number of iterations through a generator according to the training set and the target set;
[0236] The processing unit 902 is further configured to output a first new feature if the first iteration number reaches a third preset threshold;
[0237] The processing unit 902 is further configured to generate a second new feature corresponding to a second number of iterations through a generator according to the training set and the target set if the first number of iterations does not reach a third preset threshold.
[0238] Optionally, in the above Fig. 9 On the basis of the corresponding embodiments, in an optional embodiment of the device for model training provided in the embodiments of the present application,
[0239] The processing unit 902 is further configured to generate a first new feature through a generator according to the training set and the target set;
[0240] The processing unit 902 is also used to calculate the parameter change value of the generator;
[0241] The processing unit 902 is further configured to output the first new feature if the parameter change value of the generator is less than a fourth preset threshold;
[0242] The processing unit 902 is also used to generate a second new feature through the generator according to the training set and the target set if the parameter change value of the generator is not less than a fourth preset threshold.
[0243] Fig.10A schematic diagram of a server structure provided for an embodiment of the present application, the server 1000 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1022 (for example, one or more processors) and a memory 1032, and one or more storage media 1030 (for example, one or more mass storage devices) storing application programs 1042 or data 1044. Among them, the memory 1032 and the storage medium 1030 can be short-term storage or permanent storage. The program stored in the storage medium 1030 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1022 can be configured to communicate with the storage medium 1030 and execute a series of instruction operations in the storage medium 1030 on the server 1000.
[0244] The server 1000 may also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1058, and / or one or more operating systems 1041, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0245] The steps performed by the server in the above embodiment can be based on the Fig.10 The server structure shown.
[0246] In the embodiment of the present application, CPU 1022 is used to perform the following steps:
[0247] Acquire a training set and a target set, wherein the training set includes at least one data sample, and the target set is a preset predicted data distribution sample set;
[0248] Inputting the training set and the target set into a generative adversarial network, and generating new features of the training set through the generative adversarial network;
[0249] Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample;
[0250] The training samples are used to perform model training.
[0251] The generative adversarial network includes a generator, a first discriminator and a second discriminator. In the embodiment of the present application, the CPU 1022 is also used to perform the following steps:
[0252] The generator receives the training set and the target set and generates new features;
[0253] Output the training set and target set with new features through the generator;
[0254] Distinguish the positive samples and negative samples of the training set output by the generator through the first discriminator;
[0255] The second discriminator distinguishes the training set and the target set output by the generator.
[0256] In the embodiment of the present application, the CPU 1022 is also used to perform the following steps:
[0257] A training set, a target set, a first label, and a second label are received through a generator, wherein the first label is used to distinguish between the training set and the target set, and the second label is used to distinguish between positive samples and negative samples in the training set;
[0258] Update the parameters of the generator and the first discriminator with the goal of minimizing the output of the overall loss function;
[0259] Generate new features through the generator with updated parameters.
[0260] In the embodiment of the present application, the CPU 1022 is also used to perform the following steps:
[0261] Receive the training set, the target set and the first label output by the generator through the second discriminator;
[0262] Update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function;
[0263] The training set and target set output by the generator are distinguished by the second discriminator after parameter update.
[0264] In the embodiment of the present application, the CPU 1022 is also used to perform the following steps:
[0265] Generate a first new feature through a generator according to a training set and a target set;
[0266] Calculate the accuracy of the second discriminator based on the training set and the target set having the first new feature;
[0267] If the accuracy of the second discriminator is less than the second preset threshold, outputting the first new feature;
[0268] If the accuracy of the second discriminator is not less than the second preset threshold, a second new feature is generated by the generator according to the training set and the target set.
[0269] In the embodiment of the present application, the CPU 1022 is also used to perform the following steps:
[0270] Generate a first new feature corresponding to a first number of iterations by a generator according to a training set and a target set;
[0271] If the first iteration number reaches a third preset threshold, outputting the first new feature;
[0272] If the first iteration number does not reach the third preset threshold, a second new feature corresponding to a second iteration number is generated by a generator according to the training set and the target set.
[0273] In the embodiment of the present application, the CPU 1022 is also used to perform the following steps:
[0274] Generate a first new feature through a generator according to a training set and a target set;
[0275] Calculate the parameter change value of the generator;
[0276] If the parameter change value of the generator is less than a fourth preset threshold, outputting the first new feature;
[0277] If the parameter change value of the generator is not less than the fourth preset threshold, a second new feature is generated by the generator according to the training set and the target set.
[0278] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0279] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0280] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0281] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0282] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
Claims
1. A model training method, characterized in that: include: Acquire a training set and a target set, wherein the training set includes at least one data sample, the target set is a preset predicted data distribution sample set, and the data sample is an image selected from an image database; Inputting the training set and the target set into a generative adversarial network, generating new features of the training set through the generative adversarial network, wherein the generative adversarial network includes a generator, a first discriminator, and a second discriminator. The generative adversarial network receives the training set and the target set through the generator, generates the new features, and outputs the training set and the target set with the new features. The first discriminator is used to distinguish between positive samples and negative samples of the training set output by the generator; Calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first preset threshold as a training sample; Using the training samples to perform model training; The process of the generator generating the new feature includes: Receiving, by the generator, the training set, the target set, a first label, and a second label, wherein the first label is used to distinguish the training set from the target set, and the second label is used to distinguish the positive sample from the negative sample of the training set; Update the parameters of the generator and the parameters of the first discriminator with the goal of minimizing the output of the overall loss function; The new feature is generated by the generator after parameter update.
2. The method according to claim 1, characterized in that: The generative adversarial network also includes a second discriminator; The training set and the target set output by the generator are distinguished by the second discriminator.
3. The method according to claim 2, characterized in that The distinguishing the training set and the target set output by the generator through the second discriminator comprises: Receiving the training set, the target set and the first label output by the generator through the second discriminator; Updating the parameters of the second discriminator with the goal of minimizing the output of the overall loss function; The training set and the target set output by the generator are distinguished by the second discriminator after parameter update.
4. The method according to claim 2, characterized in that: Inputting the training set and the target set into a generative adversarial network, and generating new features of the training set through the generative adversarial network includes: Generate a first new feature by the generator according to the training set and the target set; Calculate the accuracy of the second discriminator according to the training set and the target set having the first new feature; If the accuracy of the second discriminator is less than a second preset threshold, outputting the first new feature; If the accuracy of the second discriminator is not less than a second preset threshold, a second new feature is generated by the generator according to the training set and the target set.
5. The method according to claim 2, characterized in that: Inputting the training set and the target set into a generative adversarial network, and generating new features of the training set through the generative adversarial network includes: Generate a first new feature corresponding to a first number of iterations by the generator according to the training set and the target set; If the first iteration number reaches a third preset threshold, outputting the first new feature; If the first iteration number does not reach a third preset threshold, a second new feature corresponding to a second iteration number is generated by the generator according to the training set and the target set.
6. The method according to claim 2, characterized in that Inputting the training set and the target set into a generative adversarial network, and generating new features of the training set through the generative adversarial network includes: Generate a first new feature by the generator according to the training set and the target set; Calculating parameter change values of the generator; If the parameter change value of the generator is less than a fourth preset threshold, outputting the first new feature; If the parameter change value of the generator is not less than a fourth preset threshold, a second new feature is generated by the generator according to the training set and the target set.
7. A model training device, characterized in that: include: An acquisition unit, configured to acquire a training set and a target set, wherein the training set includes at least one data sample, the target set is a preset predicted data distribution sample set, and the data sample is an image selected from an image database; a processing unit, configured to input the training set and the target set into a generative adversarial network, and generate new features of the training set through the generative adversarial network, wherein the generative adversarial network includes a generator, a first discriminator, and a second discriminator, wherein the generative adversarial network receives the training set and the target set through the generator, generates the new features, and outputs the training set and the target set having the new features, wherein the first discriminator is configured to distinguish between positive samples and negative samples of the training set output by the generator; The processing unit is further used to calculate the similarity between the training set and the target set according to the new feature, and select the training set whose similarity exceeds a first threshold as a training sample; A training unit, used for performing model training using the training samples; The processing unit is specifically used for: Receiving, by the generator, the training set, the target set, a first label, and a second label, wherein the first label is used to distinguish the training set from the target set, and the second label is used to distinguish the positive sample from the negative sample of the training set; Update the parameters of the generator and the parameters of the first discriminator with the goal of minimizing the output of the overall loss function; The new feature is generated by the generator after parameter update.
8. The device according to claim 7, characterized in that The generative adversarial network includes a second discriminator; The processing unit also distinguishes the training set and the target set output by the generator through the second discriminator.
9. The device according to claim 8, characterized in that The processing unit is further configured to receive the training set, the target set and the first label output by the generator through the second discriminator; The processing unit is further used to update the parameters of the second discriminator with the goal of minimizing the output of the overall loss function; The processing unit is also used to distinguish the training set and the target set output by the generator through the second discriminator after parameter update.
10. The device according to claim 8, characterized in that The processing unit is also used to generate a first new feature through a generator according to the training set and the target set; The processing unit is further configured to generate a first new feature through the generator according to the training set and the target set; The processing unit is further used to calculate the accuracy of the second discriminator according to the training set and the target set having the first new feature; The processing unit is further configured to output the first new feature if the accuracy of the second discriminator is less than a second preset threshold; The processing unit is further configured to generate a second new feature through the generator according to the training set and the target set if the accuracy of the second discriminator is not less than a second preset threshold.
11. The device according to claim 8, characterized in that The processing unit is further configured to generate a first new feature corresponding to a first number of iterations through the generator according to the training set and the target set; The processing unit is further configured to output the first new feature if the first iteration number reaches a third preset threshold; The processing unit is also used to generate a second new feature corresponding to a second number of iterations through the generator according to the training set and the target set if the first number of iterations does not reach a third preset threshold.
12. The device according to claim 8, characterized in that The processing unit is further configured to generate a first new feature through the generator according to the training set and the target set; The processing unit is also used to calculate the parameter change value of the generator; The processing unit is further configured to output the first new feature if the parameter change value of the generator is less than a fourth preset threshold; The processing unit is also used to generate a second new feature through the generator according to the training set and the target set if the parameter change value of the generator is not less than a fourth preset threshold.
13. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 6.
14. A computer program product comprising instructions, characterized in that When the method is executed on a computer or a processor, the computer or the processor is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
A method and apparatus for realizing model optimization
CN109213805A
Method for identifying medical image, method for model training and server
CN109461495A