CN112541557B - Training method and device for generating countermeasure network and electronic equipment - Google Patents

Training method and device for generating countermeasure network and electronic equipment Download PDF

Info

Publication number
CN112541557B
CN112541557B CN202011562340.5A CN202011562340A CN112541557B CN 112541557 B CN112541557 B CN 112541557B CN 202011562340 A CN202011562340 A CN 202011562340A CN 112541557 B CN112541557 B CN 112541557B
Authority
CN
China
Prior art keywords
interference
image sample
probability
sample
countermeasure network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011562340.5A
Other languages
Chinese (zh)
Other versions
CN112541557A (en
Inventor
余晓峰
郑立涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011562340.5A priority Critical patent/CN112541557B/en
Publication of CN112541557A publication Critical patent/CN112541557A/en
Application granted granted Critical
Publication of CN112541557B publication Critical patent/CN112541557B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a training method, a training device and electronic equipment for a generated type countermeasure network, relates to the technical field of artificial intelligence, and particularly relates to the technical field of deep learning and natural language processing. The specific implementation scheme is as follows: determining the current respectively corresponding interference probability of each interference sample in the interference sample set; acquiring a target interference sample from the interference sample set according to the current corresponding interference probability of each interference sample; processing the target interference sample by using a generator in the generating type countermeasure network to generate a discrimination sample; inputting the discrimination sample into a discriminator in a generating type countermeasure network to obtain the probability that the discrimination sample belongs to a real sample; and correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability. Therefore, through the training method of the generated type countermeasure network, the noise immunity and generalization of the generated type countermeasure network are improved.

Description

Training method and device for generating countermeasure network and electronic equipment
Technical Field
The application relates to the technical field of computers, in particular to the technical field of artificial intelligence such as deep learning, natural language processing and the like, and provides a training method, a training device and electronic equipment for a generated type countermeasure network.
Background
Sequence labeling is an important basic tool in the application fields of information extraction, question and answer systems, syntactic analysis, machine translation and the like, and plays an important role in the process of the natural language processing technology to be put into practical use. The core word recognition is used as a specific sequence labeling task, aims at recognizing the core appeal and intention of a user in a short text, and plays an important role in advertisement triggering, problem redness and service point mining.
In the related art, a large amount of high-quality labeling data is needed based on a pre-trained and fine-tuned sequence labeling model, and when the labeling data is low in quality or inconsistent in labeling, the performance of the model is seriously affected.
Disclosure of Invention
The application provides a training method, a training device, an electronic device, a storage medium and a computer program product for a generative countermeasure network.
According to an aspect of the present application, there is provided a training method of a generated countermeasure network, including: determining the current respectively corresponding interference probability of each interference sample in the interference sample set; obtaining a target interference sample from the interference sample set according to the interference probability corresponding to each interference sample currently; processing the target interference sample by using a generator in the generating type countermeasure network to generate a discrimination sample; inputting the discrimination sample into a discriminator in the generated countermeasure network to obtain the probability that the discrimination sample belongs to a real sample; and correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability.
According to another aspect of the present application, there is provided a training apparatus of a generative antagonism network, comprising: the first determining module is used for determining the current respectively corresponding interference probability of each interference sample in the interference sample set; the first acquisition module is used for acquiring a target interference sample from the interference sample set according to the interference probability corresponding to each interference sample currently; the generation module is used for processing the target interference sample by utilizing a generator in the generation type countermeasure network so as to generate a discrimination sample; the second acquisition module is used for inputting the discrimination sample into a discriminator in the generated countermeasure network so as to acquire the probability that the discrimination sample belongs to a real sample; and the first correction module is used for correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability.
According to still another aspect of the present application, there is provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of training a generative countermeasure network as previously described.
According to yet another aspect of the present application, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the training method of a generative countermeasure network as previously described.
According to a further aspect of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a training method of a generative countermeasure network as previously described.
According to the technical scheme, the problem that in the related technology, a large amount of high-quality annotation data is needed based on the pre-trained and fine-tuned sequence annotation model, and when the quality of the annotation data is low or the annotation is inconsistent, the performance of the model is seriously affected is solved. Obtaining a target interference sample from the interference sample set according to the current corresponding interference probability of each interference sample in the interference sample set, and processing the target interference sample by using a generator in a generating type countermeasure network to generate a discrimination sample; and inputting the discrimination sample into a discriminator in the generated countermeasure network to acquire the probability that the discrimination sample belongs to the real sample, and correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability. Therefore, by inserting the interference sample in the training process, the recognition capability of the generated type antagonism network to the low-quality sample is improved, and the noise resistance and generalization of the generated type antagonism network are improved.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
fig. 1 is a flowchart of a training method of a generated countermeasure network according to an embodiment of the present application;
FIG. 2 is a flowchart of another training method for generating an countermeasure network according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of another training method for generating an countermeasure network according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a training device for generating an countermeasure network according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing a training method of a generated countermeasure network in accordance with an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The technical field to which the solution of the present application relates is briefly described below:
artificial intelligence is the discipline of studying the process of making a computer mimic certain mental processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.) of a person, both hardware-level and software-level techniques. Artificial intelligence hardware technologies generally include computer vision technologies, speech recognition technologies, natural language processing technologies, machine learning/deep learning, big data processing technologies, knowledge graph technologies, and the like.
Deep learning is a new research direction in the field of machine learning, and it was introduced into machine learning to make it closer to the original goal-artificial intelligence. Deep learning is the inherent regularity and presentation hierarchy of learning sample data, and the information obtained during such learning is helpful in interpreting data such as text, images and sounds. Its final goal is to have the machine have analytical learning capabilities like a person, and to recognize text, image, and sound data. Deep learning has achieved many results in search technology, data mining, machine learning, machine translation, natural language processing, multimedia learning, speech, recommendation and personalization techniques, and other related fields.
Natural language processing is an important direction in the fields of computer science and artificial intelligence. It is studying various theories and methods that enable effective communication between a person and a computer in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Thus, the research in this field will involve natural language, i.e. language that people use daily, so it has a close relation with the research in linguistics, but has important differences. Natural language processing is not a general study of natural language, but rather, is the development of computer systems, and in particular software systems therein, that can effectively implement natural language communications. It is thus part of computer science.
Aiming at the problem that the performance of a model is seriously affected when the quality of the labeling data is low or the labeling is inconsistent in the related art, the embodiment of the application provides a training method of a generated type countermeasure network based on a pre-trained and fine-tuned sequence labeling model.
The training method, apparatus, electronic device, storage medium and computer program product of the generated type countermeasure network provided in the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a training method of a generated challenge network according to an embodiment of the present application.
As shown in fig. 1, the training method of the generated countermeasure network includes the following steps:
step 101, determining the current interference probability corresponding to each interference sample in the interference sample set.
It should be noted that, the training method of the generated type countermeasure network according to the embodiment of the present application may be executed by the training apparatus of the generated type countermeasure network according to the embodiment of the present application, and the training apparatus of the generated type countermeasure network according to the embodiment of the present application may be configured in any electronic device to execute the training method of the generated type countermeasure network according to the embodiment of the present application.
In the embodiment of the present application, the training method of the generated type countermeasure network in the embodiment of the present application may be applied to training scenes including models of the generated type countermeasure network, such as sequence labeling, image processing, and so on, so as to generate a required image processing model or sequence labeling model, and so on.
The interference sample set may refer to a sample set with a low labeling quality including a false labeling.
The interference probability corresponding to the interference sample may refer to a probability that the labeling data corresponding to the interference sample is a false label.
In the embodiment of the application, when the generated type countermeasure network is trained, the generated type countermeasure network can be trained by utilizing the reliable sample set R and the interference sample set U at the same time, so that the anti-noise and generalization of the generated type countermeasure network are improved by improving the identification capability of the generated type countermeasure network to the interference samples.
As one possible implementation, each interference sample in the set of interference samples may be processed by a generator in the generative antagonism network to generate a respective current interference probability for each interference sample.
Step 102, obtaining a target interference sample from the interference sample set according to the interference probability corresponding to each interference sample.
The target interference sample refers to an interference sample with a larger interference probability corresponding to the interference sample set.
In the embodiment of the present application, after determining the current corresponding interference probability of each interference sample, the greater the current corresponding interference probability of the interference sample, the greater the probability that the labeling data corresponding to the interference sample is the error labeling is, so that the interference sample with the greater interference probability can be selected to participate in the training of generating the countermeasure network, so as to improve the recognition capability of the generated countermeasure network to the unreliable sample in the iterative training process. For example, a generator may be used to generate a current corresponding interference probability for each interference sample, and determine the interference sample with the largest current corresponding interference probability as the target interference sample.
Step 103, processing the target interference sample by using a generator in the generation type countermeasure network to generate a discrimination sample.
As a possible implementation manner, the generator in the generating type countermeasure network may generate, according to the target interference sample, labeling data corresponding to the target interference sample, and use the labeling data generated by the generator of the target interference sample as the discrimination sample.
As another possible implementation manner, the generator may directly use the target interference sample and the corresponding labeling data thereof as the discrimination sample.
Step 104, inputting the discrimination sample into a discriminator in the generated countermeasure network to obtain the probability that the discrimination sample belongs to the true sample.
The probability that the discrimination sample belongs to the real sample may refer to the probability that the labeling data in the discrimination sample is a correct label.
In the embodiment of the application, the discrimination sample can be input into the discriminator in the generated countermeasure network, so that the discriminator generates the probability that the discrimination sample belongs to the real sample, and the performance of the generator for identifying the target interference sample and the precision of generating the labeling data are improved according to the identification result of the discriminator on the discrimination sample in the countermeasure training process.
As a possible implementation manner, when training the generated countermeasure network, the generated countermeasure network may be trained simultaneously by using the reliable sample set R and the interference sample set U, so that each reliable sample in the reliable sample set may be input into the discriminator, so that the discriminator generates a probability that each reliable sample belongs to a real sample.
And 105, correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability.
In the embodiment of the application, the probability that the discrimination sample belongs to the real sample can reflect the discrimination precision of the discriminator, and also can reflect the precision of the label data generated by the generator, and the interference probability corresponding to the discrimination sample can reflect the precision of the target interference sample selected by the generator, so that the loss value of the countermeasure network can be generated according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability, and the parameters of the generator and the discriminator in the generated countermeasure network are corrected according to the loss value, so that the precision of the generator and the discriminator is improved.
According to the technical scheme of the embodiment of the application, the target interference samples are obtained from the interference sample set according to the current interference probabilities respectively corresponding to the interference samples in the interference sample set, and the target interference samples are processed by using the generator in the generating type countermeasure network so as to generate the discrimination samples; and inputting the discrimination sample into a discriminator in the generated countermeasure network to acquire the probability that the discrimination sample belongs to the real sample, and correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability. Therefore, by inserting the interference sample in the training process, the recognition capability of the generated type antagonism network to the low-quality sample is improved, and the noise resistance and generalization of the generated type antagonism network are improved.
In one possible implementation form of the method, the current interference probability of the interference sample can be calculated after the interference sample is converted into the hyperplane, so that the accuracy of the interference probability is improved, and the accuracy of the generated type countermeasure network is further improved.
The training method of the generated challenge network according to the embodiment of the present application is further described below with reference to fig. 2.
Fig. 2 is a flowchart of another training method of a generated challenge network according to an embodiment of the present application.
As shown in fig. 2, the training method of the generated countermeasure network includes the following steps:
in step 201, each interference sample in the set of interference samples is encoded separately using an encoder in the generated antagonism network to determine a vector representation of each interference sample.
In an embodiment of the present application, the generating countermeasure network may further include an encoder, and each interference sample in the interference sample set is input to the encoder, and a vector representation of each interference sample is generated, so that the generator directly processes the vector representation of each interference sample.
When the generated countermeasure network is trained by simultaneously using the reliable sample set R and the interference sample set U, each reliable sample in the reliable sample set R may be input to the encoder to generate a vector representation corresponding to each reliable sample.
Step 202, determining a current corresponding hyperplane of each interference sample in the interference sample set based on a preset hyperplane parameter.
In the embodiment of the present application, a preset hyperplane parameter may be used to determine a hyperplane corresponding to each interference sample currently, with a vector representation corresponding to each interference sample. The hyperplane to which the interference sample corresponds can be determined by equation (1).
g(x)=Wx+b (1)
Wherein x is a vector representation corresponding to the interference sample, g (x) is a hyperplane corresponding to the interference sample x, and W and b are preset hyperplane parameters.
Step 203, calculating the interference probability corresponding to each interference sample according to the hyperplane corresponding to each interference sample.
In the embodiment of the present application, after determining the hyperplane corresponding to each interference sample currently, the interference probability corresponding to each interference sample currently may be determined according to formula (2).
Wherein P is U (x,θ G ) For the current corresponding interference probability of the interference sample x, U is the interference sample set, x is the vector representation of the interference sample, θ G The parameters corresponding to the generator are generated and,for the vector representation of all interference samples in the interference sample set U, g (x) is the hyperplane corresponding to interference sample x, ++>Is the hyperplane of all interference samples in the interference sample set U.
P is the same as U (x,θ G ) The larger the interference sample x, the more prone to error and aliasing.
Step 204, obtaining a target interference sample from the interference sample set according to the interference probability corresponding to each interference sample.
In step 205, the target interference samples are processed by a generator in the generation type antagonism network to generate discrimination samples.
Step 206, inputting the discrimination sample into a discriminator in the generated countermeasure network to obtain the probability that the discrimination sample belongs to the true sample.
Step 207, correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability.
The specific implementation and principles of the steps 204-207 may refer to the detailed description of the embodiments, and are not repeated here.
According to the technical scheme of the embodiment of the application, each interference sample in the interference sample set is respectively encoded by utilizing an encoder in the generation type antagonism network to determine vector representation of each interference sample, each interference sample in the interference sample set is converted to a hyperplane to calculate interference probability currently corresponding to each interference sample according to the hyperplane currently corresponding to each interference sample, then a target interference sample is obtained from the interference sample set according to the interference probability currently corresponding to each interference sample in the interference sample set, and the target interference sample is processed by utilizing a generator in the generation type antagonism network to generate a discrimination sample, and then the discrimination sample is input into a discriminator in the generation type antagonism network to obtain probability that the discrimination sample belongs to a real sample, so that the generation type antagonism network is corrected according to probability that the discrimination sample belongs to the real sample and the corresponding interference probability. Therefore, by inserting the interference sample in the training process, the recognition capability of the generated type antagonism network to the low-quality sample is improved, and the current interference probability of the interference sample is calculated after the interference sample is converted to the hyperplane, so that the accuracy of the interference probability is improved, the noise immunity and generalization of the generated type antagonism network are improved, and the precision of the generated type antagonism network is further improved.
In one possible implementation form of the method, the loss values of the generator and the discriminator can be generated respectively so as to correct parameters corresponding to the generator and the discriminator respectively, and further improve the training effect of the generated countermeasure network.
The training method of the generated challenge network according to the embodiment of the present application is further described below with reference to fig. 3.
Fig. 3 is a flowchart of another training method of a generated countermeasure network according to an embodiment of the present application.
As shown in fig. 3, the training method of the generated countermeasure network includes the following steps:
in step 301, each interference sample in the set of interference samples is encoded separately using an encoder in the generated antagonism network to determine a vector representation of each interference sample.
Step 302, determining the current interference probability corresponding to each interference sample in the interference sample set.
Step 303, obtaining a target interference sample from the interference sample set according to the interference probability corresponding to each interference sample.
In step 304, the target interference samples are processed by a generator in the generation-type countermeasure network to generate discrimination samples.
In step 305, the discrimination sample is input to a discriminator in the generated countermeasure network to obtain a probability that the discrimination sample belongs to the true sample.
The specific implementation process and principle of the above steps 301 to 305 may refer to the detailed description of the above embodiments, which is not repeated here.
Step 306, determining a first loss value and a second loss value according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability.
As a possible implementation manner, since the difference between the probability distribution of the true sample belonging to the discrimination sample generated by the discriminator and the interference probability distribution corresponding to the interference sample determined by the generator may reflect the precision of the generator and the discrimination precision of the discriminator, the first loss value and the second loss value may be determined according to the probability of the true sample belonging to the discrimination sample and the corresponding interference probability, so as to respectively correct the parameters corresponding to the generator and the discriminator. Wherein the first loss value may be determined by equation (3) and the second loss value may be determined by equation (4).
Wherein,for the first loss value, x is the interference sample, U is the interference sample set, θ G Parameters corresponding to generator, P U (x,θ G ) To interfere with the probability of interference of sample x, P (y|x, θ) D ) Probability of discriminating sample corresponding to interference sample x generated by discriminator belonging to true sample, θ D Is the parameter corresponding to the discriminator.
Wherein,for the second loss value, U is the interference sample set, P U (x,θ G ) For the interference probability, θ, of the interference samples x in the interference sample set U G Parameters corresponding to the generator, P (y|x,θ D ) The probability that the discrimination sample corresponding to the interference sample x generated for the discriminator belongs to the true sample.
Step 307, correcting the generator according to the first loss value.
In the embodiment of the application, after the first loss value is determined, the parameters corresponding to the generator can be corrected according to the first loss value, so that the accuracy of the generator in determining the interference probability is continuously improved, and the interference sample which is most easily confused and has errors is selected as far as possible to be transmitted to the discriminator; and the accuracy of generating the annotation data by the generator is continuously improved.
Step 308, correcting the discriminator according to the second loss value.
In the embodiment of the application, after the second loss value is determined, the parameters corresponding to the discriminator can be corrected according to the second loss value, so that the probability that the reliable sample in the reliable sample set R generated by the discriminator belongs to the real sample is larger and larger, and the probability that the discriminating sample generated by the discriminator belongs to the real sample is smaller and smaller, and the discriminating precision of the discriminator is improved.
Further, when the generated countermeasure network is trained, the generated countermeasure network can be trained by utilizing the reliable sample set R and the interference sample set U, and the discriminators need to process samples in the reliable sample set R and the interference sample set U at the same time, so that loss values of the discriminators can be generated according to discrimination results of the discriminators on the reliable sample set R and the interference sample set U, and training accuracy of the discriminators is guaranteed. That is, in one possible implementation manner of the embodiment of the present application, the method may further include:
inputting the labeling sample into a discriminator in a generating type countermeasure network to obtain the probability that the labeling sample belongs to a real sample;
determining a third loss value according to the probability that the labeling sample belongs to the real sample;
and correcting the discriminator according to the third loss value.
The labeling of the sample may refer to reliable samples in the reliable sample set.
In this embodiment of the present application, when the reliable sample set R and the interference sample set U are used to train the generated type countermeasure network at the same time, the third loss value may also be generated according to the discrimination result of the discriminator on the labeled sample in the reliable sample set R, so as to correct the parameter corresponding to the discriminator. Wherein the third loss value may be determined by equation (5).
Wherein,for the third loss value, R is the set of reliable samples, logP (y|x, θ D ) Probability that labeling sample x generated for discriminator belongs to real sample, theta D Is the parameter corresponding to the discriminator.
As a possible implementation manner, when the generated countermeasure network is trained by using the reliable sample set R and the interference sample set U at the same time, the parameters corresponding to the discriminators can be corrected at the same time according to the second loss value and the third loss value. Therefore, the total loss value corresponding to the discriminator can be determined according to the second loss value and the third loss value, and the parameter corresponding to the discriminator is corrected according to the total loss value corresponding to the discriminator. Wherein, the total loss value corresponding to the discriminator can be determined by the formula (6).
Wherein,for the total loss value of the arbiter, R is a reliable sample set, log P (y|x, θ D ) Probability that labeling sample x in reliable sample set R generated for discriminator belongs to real sample, theta D For parameters corresponding to the discriminator, U interferes with the sample set, P U (x,θ G ) For the interference probability, θ, of the interference samples x in the interference sample set U G Parameters corresponding to the generator, P (y|x, θ) D ) The probability that the discrimination sample corresponding to the interference sample x generated for the discriminator belongs to the true sample.
As a possible implementation manner, in order to make the discriminator pay more attention to the difficult and error-prone samples, the total loss value corresponding to the discriminator may be corrected by using a label smoothing technology, so as to further improve the noise immunity and generalization of the generated type countermeasure network. Wherein the second loss value can be corrected by the formula (7).
Wherein,for the corrected total loss value of the arbiter, epsilon is a smaller super parameter,for the total loss value corresponding to the discriminator, y 1 Any one or more classes of labels are labeled for multiple classes.
In practical use, y can be determined according to practical needs and specific application scenarios 1 To make the arbiter pay more attention to y 1 Is a sample of (b).
Step 309, correcting the encoder according to the first loss value and the second loss value.
In the embodiment of the application, when the encoder is included in the generating countermeasure network, since the output of the encoder needs to be input to both the generator and the arbiter, the global loss value may be generated according to the first loss value and the second loss value to correct the encoder. Wherein the global loss value may be determined by equation (8).
Wherein, For global loss value, ++>For the second loss value, +.>For the first loss value, λ is an adjustable coefficient.
It should be noted that, during actual use, the value of λ may be adjusted according to the actual needs and specific application scenarios, so as to balance the correction weights of the first loss value and the second loss value on the encoder.
According to the technical scheme of the embodiment of the application, the target interference samples are obtained from the interference sample set according to the current interference probabilities respectively corresponding to the interference samples in the interference sample set, and the target interference samples are processed by using the generator in the generating type countermeasure network so as to generate the discrimination samples; and then inputting the discrimination sample into a discriminator in the generating type countermeasure network to obtain the probability that the discrimination sample belongs to a real sample, and further respectively correcting parameters corresponding to the generator and the discriminator according to the loss values of the generator and the discriminator. Therefore, by inserting the interference sample in the training process, the recognition capability of the generation type antagonism network to the low-quality sample is improved, and the generator and the discriminator are respectively corrected according to different loss values, so that the noise immunity and generalization of the generation type antagonism network are further improved.
In order to implement the above embodiment, the present application further proposes a training device for a generated countermeasure network.
Fig. 4 is a schematic structural diagram of a training device for generating an countermeasure network according to an embodiment of the present application.
As shown in fig. 4, the training device 40 for generating an countermeasure network includes:
a first determining module 41, configured to determine interference probabilities that each interference sample in the interference sample set currently corresponds to each interference sample;
a first obtaining module 42, configured to obtain a target interference sample from the interference sample set according to the interference probability currently corresponding to each interference sample;
a generating module 43, configured to process the target interference sample by using a generator in the generating type countermeasure network to generate a discrimination sample;
a second obtaining module 44, configured to input the discrimination sample into a discriminator in the generated type countermeasure network, so as to obtain a probability that the discrimination sample belongs to the real sample;
the first correction module 45 is configured to correct the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability.
In practical use, the training apparatus for a generated countermeasure network provided in the embodiment of the present application may be configured in any electronic device to execute the foregoing training method for a generated countermeasure network.
According to the technical scheme of the embodiment of the application, the target interference samples are obtained from the interference sample set according to the current interference probabilities respectively corresponding to the interference samples in the interference sample set, and the target interference samples are processed by using the generator in the generating type countermeasure network so as to generate the discrimination samples; and inputting the discrimination sample into a discriminator in the generated countermeasure network to acquire the probability that the discrimination sample belongs to the real sample, and correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability. Therefore, by inserting the interference sample in the training process, the recognition capability of the generated type antagonism network to the low-quality sample is improved, and the noise resistance and generalization of the generated type antagonism network are improved.
In one possible implementation form of the present application, the first determining module 41 includes:
the first determining unit is used for determining the current corresponding hyperplane of each interference sample in the interference sample set based on a preset hyperplane parameter;
and the calculating unit is used for calculating the interference probability corresponding to each interference sample currently according to the hyperplane corresponding to each interference sample currently.
Further, in another possible implementation form of the present application, the training device 40 for generating an countermeasure network further includes:
a second determination module for encoding each of the interference samples in the set of interference samples separately using an encoder in the generated antagonism network to determine a vector representation of each of the interference samples.
Further, in still another possible implementation form of the present application, the first correction module 45 includes:
the second determining unit is used for determining a first loss value and a second loss value according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability;
the first correction unit is used for correcting the generator according to the first loss value;
and the second correction unit is used for correcting the discriminator according to the second loss value.
Further, in still another possible implementation form of the present application, the training device 40 for generating an countermeasure network further includes:
and the second correction module is used for correcting the encoder according to the first loss value and the second loss value.
Further, in still another possible implementation form of the present application, the training device 40 for generating an countermeasure network further includes:
The third acquisition module is used for inputting the labeling sample into a discriminator in the generating type countermeasure network so as to acquire the probability that the labeling sample belongs to the real sample;
the third determining module is used for determining a third loss value according to the probability that the marked sample belongs to the real sample;
and the third correction module is used for correcting the discriminator according to the third loss value.
It should be noted that the explanation of the embodiment of the training method of the generated type countermeasure network shown in fig. 1, 2 and 3 is also applicable to the training device 40 of the generated type countermeasure network of the embodiment, and will not be repeated here.
According to the technical scheme of the embodiment of the application, the target interference samples are obtained from the interference sample set according to the current interference probabilities respectively corresponding to the interference samples in the interference sample set, and the target interference samples are processed by using the generator in the generating type countermeasure network so as to generate the discrimination samples; and then inputting the discrimination sample into a discriminator in the generating type countermeasure network to obtain the probability that the discrimination sample belongs to a real sample, and further respectively correcting parameters corresponding to the generator and the discriminator according to the loss values of the generator and the discriminator. Therefore, by inserting the interference sample in the training process, the recognition capability of the generation type antagonism network to the low-quality sample is improved, and the generator and the discriminator are respectively corrected according to different loss values, so that the noise immunity and generalization of the generation type antagonism network are further improved.
According to embodiments of the present application, there is also provided an electronic device, a readable storage medium and a computer program product.
Fig. 5 shows a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 5, the apparatus 500 includes a computing unit 501 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, ROM 502, and RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Various components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, etc.; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508 such as a magnetic disk, an optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the training method of the generative countermeasure network. For example, in some embodiments, the training method of the generative antagonism network may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the training method of the generated countermeasure network described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the training method of the generated countermeasure network in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS (Virtual Private Server ) service are overcome. The server may also be a server of a distributed system or a server that incorporates blockchains.
According to the technical scheme of the embodiment of the application, the target interference samples are obtained from the interference sample set according to the current interference probabilities respectively corresponding to the interference samples in the interference sample set, and the target interference samples are processed by using the generator in the generating type countermeasure network so as to generate the discrimination samples; and inputting the discrimination sample into a discriminator in the generated countermeasure network to acquire the probability that the discrimination sample belongs to the real sample, and correcting the generated countermeasure network according to the probability that the discrimination sample belongs to the real sample and the corresponding interference probability. Therefore, by inserting the interference sample in the training process, the recognition capability of the generated type antagonism network to the low-quality sample is improved, and the noise resistance and generalization of the generated type antagonism network are improved.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (11)

1. A training method of a generative countermeasure network, for image processing, the method comprising:
determining the current respectively corresponding interference probability of each interference image sample in the interference image sample set;
obtaining a target interference image sample from the interference image sample set according to the interference probability currently corresponding to each interference image sample;
processing the target interference image sample by using a generator in the generating type countermeasure network to generate a discrimination image sample;
inputting the discrimination image sample into a discriminator in the generated countermeasure network to obtain the probability that the discrimination image sample belongs to a real image sample;
correcting the generated countermeasure network according to the probability that the judging image sample belongs to the real image sample and the corresponding interference probability;
The determining the interference probability of each interference image sample in the interference image sample set, which corresponds to each interference image sample currently, includes:
determining a hyperplane currently corresponding to each interference image sample in the interference image sample set based on preset hyperplane parameters;
calculating the current corresponding interference probability of each interference image sample according to the current corresponding hyperplane of each interference image sample;
the correcting the generated countermeasure network according to the probability that the distinguishing image sample belongs to the real image sample and the corresponding interference probability includes:
determining a first loss value and a second loss value according to the probability that the judging image sample belongs to the real image sample and the corresponding interference probability;
correcting the generator according to the first loss value;
and correcting the discriminator according to the second loss value.
2. The method of claim 1, wherein prior to said determining the respective current interference probabilities for each interference image sample in the set of interference image samples, further comprising:
and respectively encoding each interference image sample in the interference image sample set by utilizing an encoder in the generating type countermeasure network so as to determine a vector representation of each interference image sample.
3. The method of claim 2, further comprising:
and correcting the encoder according to the first loss value and the second loss value.
4. The method of any of claims 1-2, further comprising:
inputting a labeling image sample into a discriminator in the generated countermeasure network to obtain the probability that the labeling image sample belongs to a real image sample;
determining a third loss value according to the probability that the marked image sample belongs to the real image sample;
and correcting the discriminator according to the third loss value.
5. A training apparatus for generating a countermeasure network for image processing, the apparatus comprising:
the first determining module is used for determining the current interference probability corresponding to each interference image sample in the interference image sample set;
the first acquisition module is used for acquiring a target interference image sample from the interference image sample set according to the interference probability corresponding to each interference image sample currently;
the generation module is used for processing the target interference image sample by utilizing a generator in the generation type countermeasure network so as to generate a discrimination image sample;
The second acquisition module is used for inputting the distinguishing image sample into a discriminator in the generated countermeasure network so as to acquire the probability that the distinguishing image sample belongs to a real image sample;
the first correction module is used for correcting the generated countermeasure network according to the probability that the judging image sample belongs to the real image sample and the corresponding interference probability;
wherein the first determining module includes:
the first determining unit is used for determining a hyperplane corresponding to each interference image sample in the interference image sample set currently based on a preset hyperplane parameter;
the computing unit is used for computing the interference probability corresponding to each interference image sample currently according to the hyperplane corresponding to each interference image sample currently;
the first correction module includes:
the second determining unit is used for determining a first loss value and a second loss value according to the probability that the judging image sample belongs to the real image sample and the corresponding interference probability;
a first correction unit configured to correct the generator according to the first loss value;
and the second correction unit is used for correcting the discriminator according to the second loss value.
6. The apparatus of claim 5, further comprising:
and a second determining module, configured to encode each interference image sample in the interference image sample set by using an encoder in the generating type countermeasure network, so as to determine a vector representation of each interference image sample.
7. The apparatus of claim 6, further comprising:
and the second correction module is used for correcting the encoder according to the first loss value and the second loss value.
8. The apparatus of any of claims 5-6, further comprising:
the third acquisition module is used for inputting the marked image sample into the discriminator in the generated countermeasure network so as to acquire the probability that the marked image sample belongs to the real image sample;
the third determining module is used for determining a third loss value according to the probability that the marked image sample belongs to the real image sample;
and the third correction module is used for correcting the discriminator according to the third loss value.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-4.
CN202011562340.5A 2020-12-25 2020-12-25 Training method and device for generating countermeasure network and electronic equipment Active CN112541557B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011562340.5A CN112541557B (en) 2020-12-25 2020-12-25 Training method and device for generating countermeasure network and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011562340.5A CN112541557B (en) 2020-12-25 2020-12-25 Training method and device for generating countermeasure network and electronic equipment

Publications (2)

Publication Number Publication Date
CN112541557A CN112541557A (en) 2021-03-23
CN112541557B true CN112541557B (en) 2024-04-05

Family

ID=75017353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011562340.5A Active CN112541557B (en) 2020-12-25 2020-12-25 Training method and device for generating countermeasure network and electronic equipment

Country Status (1)

Country Link
CN (1) CN112541557B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114330924B (en) * 2022-01-10 2023-04-18 中国矿业大学 Complex product change strength prediction method based on generating type countermeasure network

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019165932A1 (en) * 2018-02-28 2019-09-06 索尼公司 Frequency spectrum management device, system, method and computer readable storage medium
CN110245619A (en) * 2019-06-17 2019-09-17 杭州海康睿和物联网技术有限公司 One kind is for object judgment method and the system of transfiniting on escalator
WO2019214365A1 (en) * 2018-05-10 2019-11-14 腾讯科技(深圳)有限公司 Translation model training method, sentence translation method and apparatus, and storage medium
CN111461307A (en) * 2020-04-02 2020-07-28 武汉大学 General disturbance generation method based on generation countermeasure network
CN111582348A (en) * 2020-04-29 2020-08-25 武汉轻工大学 Method, device, equipment and storage medium for training condition generating type countermeasure network
CN111832700A (en) * 2020-06-01 2020-10-27 北京百度网讯科技有限公司 Method and device for training conditional countermeasure network, electronic equipment and storage medium
CN111860593A (en) * 2020-06-15 2020-10-30 北京华电天仁电力控制技术有限公司 Fan blade fault detection method based on generation countermeasure network
CN111881935A (en) * 2020-06-19 2020-11-03 北京邮电大学 Countermeasure sample generation method based on content-aware GAN

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10319076B2 (en) * 2016-06-16 2019-06-11 Facebook, Inc. Producing higher-quality samples of natural images

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019165932A1 (en) * 2018-02-28 2019-09-06 索尼公司 Frequency spectrum management device, system, method and computer readable storage medium
WO2019214365A1 (en) * 2018-05-10 2019-11-14 腾讯科技(深圳)有限公司 Translation model training method, sentence translation method and apparatus, and storage medium
CN110245619A (en) * 2019-06-17 2019-09-17 杭州海康睿和物联网技术有限公司 One kind is for object judgment method and the system of transfiniting on escalator
CN111461307A (en) * 2020-04-02 2020-07-28 武汉大学 General disturbance generation method based on generation countermeasure network
CN111582348A (en) * 2020-04-29 2020-08-25 武汉轻工大学 Method, device, equipment and storage medium for training condition generating type countermeasure network
CN111832700A (en) * 2020-06-01 2020-10-27 北京百度网讯科技有限公司 Method and device for training conditional countermeasure network, electronic equipment and storage medium
CN111860593A (en) * 2020-06-15 2020-10-30 北京华电天仁电力控制技术有限公司 Fan blade fault detection method based on generation countermeasure network
CN111881935A (en) * 2020-06-19 2020-11-03 北京邮电大学 Countermeasure sample generation method based on content-aware GAN

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Generative Adversarial Nets;Ian J. Goodfellow;arXiv;20140610;1-9 *
基于生成对抗网络的小样本数据生成技术研究;杨懿男;齐林海;王红;苏林萍;;电力建设;20190501(05);75-81 *
生成对抗网络在雷达反欺骗干扰中的应用框架;杨志峰;李增辉;刘笑;冀鑫炜;王恩堂;;现代雷达;20200812(08);60-64+74 *
生成式对抗网络在不良图片识别中的应用;王宏宇;陈冬梅;;电脑迷;20180208(02);48 *

Also Published As

Publication number Publication date
CN112541557A (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN112541122A (en) Recommendation model training method and device, electronic equipment and storage medium
CN111259671A (en) Semantic description processing method, device and equipment for text entity
EP4113357A1 (en) Method and apparatus for recognizing entity, electronic device and storage medium
CN111091004B (en) Training method and training device for sentence entity annotation model and electronic equipment
CN115861462B (en) Training method and device for image generation model, electronic equipment and storage medium
CN114881129A (en) Model training method and device, electronic equipment and storage medium
CN115062718A (en) Language model training method and device, electronic equipment and storage medium
CN115829058A (en) Training sample processing method, cross-modal matching method, device, equipment and medium
CN112541557B (en) Training method and device for generating countermeasure network and electronic equipment
CN112989797B (en) Model training and text expansion methods, devices, equipment and storage medium
CN114037052A (en) Training method and device for detection model, electronic equipment and storage medium
CN113177466A (en) Identity recognition method and device based on face image, electronic equipment and medium
CN113191261A (en) Image category identification method and device and electronic equipment
CN114970666B (en) Spoken language processing method and device, electronic equipment and storage medium
CN114416941B (en) Knowledge graph-fused dialogue knowledge point determination model generation method and device
CN115565186A (en) Method and device for training character recognition model, electronic equipment and storage medium
CN115359323A (en) Image text information generation method and deep learning model training method
CN114067805A (en) Method and device for training voiceprint recognition model and voiceprint recognition
CN113886543A (en) Method, apparatus, medium, and program product for generating an intent recognition model
CN114119972A (en) Model acquisition and object processing method and device, electronic equipment and storage medium
CN114328956A (en) Text information determination method and device, electronic equipment and storage medium
CN115840867A (en) Generation method and device of mathematical problem solving model, electronic equipment and storage medium
CN112560437A (en) Text smoothness determination method and device and target model training method and device
CN114973279B (en) Training method and device for handwritten text image generation model and storage medium
CN115131709B (en) Video category prediction method, training method and device for video category prediction model

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
GR01 Patent grant
GR01 Patent grant