CN116091884A - Construction method and system of dual-discriminant generation type countermeasure network model - Google Patents

Construction method and system of dual-discriminant generation type countermeasure network model Download PDF

Info

Publication number
CN116091884A
CN116091884A CN202211333154.3A CN202211333154A CN116091884A CN 116091884 A CN116091884 A CN 116091884A CN 202211333154 A CN202211333154 A CN 202211333154A CN 116091884 A CN116091884 A CN 116091884A
Authority
CN
China
Prior art keywords
network model
generated
training
countermeasure network
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211333154.3A
Other languages
Chinese (zh)
Inventor
李文军
余治洪
王进
梁伟军
杨红忠
伍少远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha University of Science and Technology
Original Assignee
Changsha University of Science and Technology
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 Changsha University of Science and Technology filed Critical Changsha University of Science and Technology
Priority to CN202211333154.3A priority Critical patent/CN116091884A/en
Publication of CN116091884A publication Critical patent/CN116091884A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a construction method and a construction system of a dual-discriminant generation type countermeasure network model, wherein the method is characterized in that a first discriminant for distinguishing the authenticity of an image is constructed; constructing a second discriminator for calculating the similarity between the images; constructing a generated type countermeasure network model of the double discriminators and a loss function of the generated type countermeasure network model based on the generator, the first discriminator and the second discriminator; according to the loss function, training the generated type countermeasure network model by adopting the randomly generated first preset number of noise data and the selected second preset number of real images to obtain a trained generated type countermeasure network model. The invention can improve the training speed of the generated countermeasure network model and improve the quality of image generation.

Description

Construction method and system of dual-discriminant generation type countermeasure network model
Technical Field
The invention relates to the technical field of image generation, in particular to a method and a system for constructing a dual-discriminant generation type countermeasure network model.
Background
The generation of a countermeasure network (GAN) by Ian j. Goodfellow et al in 2014 proposes that the application has achieved tremendous success in the fields of image generation, image enhancement, and the like. The trained GAN network can be well fitted with the distribution of real data, so that a large number of artificial pictures are generated, and the problem of insufficient data volume in the application of real deep learning is solved. Therefore, GAN has great research significance and application value.
However GAN networks also have significant drawbacks. The first and the traditional GAN discriminators can only judge the authenticity of the pictures, and transmit the information to the generator for parameter optimization. However, this information is very limited and therefore the training process of GAN networks tends to be very lengthy. In addition, GAN training is unstable and is often prone to pattern collapse and gradient extinction. Second, there is a great deal of effort to constrain GAN using image similarity calculations so that the generator generates better quality images and mitigates the risk of pattern collapse. Most, however, measure similarity between two images by calculating image spatial distance or feature distance. The method of measuring distance through image space (such as Euclidean distance) is the most common method for calculating the similarity of two images, however, the algorithms have poor effect in calculating the image distance of high-dimensional space.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides a method and a system for constructing a double-discriminant generation type countermeasure network model, which can improve the training speed of the generation type countermeasure network model and improve the quality of image generation.
In a first aspect, an embodiment of the present invention provides a method for constructing a dual-arbiter-generated countermeasure network model, where the method for constructing a dual-arbiter-generated countermeasure network includes:
constructing a first discriminator for discriminating the authenticity of the image;
constructing a second discriminator for calculating the similarity between the images;
constructing a generated countermeasure network model of a double discriminator and a loss function of the generated countermeasure network model based on a generator, the first discriminator and the second discriminator;
and training the generated countermeasure network model by adopting a first preset number of randomly generated noise data and a second preset number of selected real images according to the loss function to obtain a trained generated countermeasure network model.
Compared with the prior art, the first aspect of the invention has the following beneficial effects:
in order to improve the training speed of the generated countermeasure network model and improve the quality of image generation, a first discriminator for discriminating the authenticity of the image is constructed; constructing a second discriminator for calculating the similarity between the images; constructing a generated type countermeasure network model of the double discriminators and a loss function of the generated type countermeasure network model based on the generator, the first discriminator and the second discriminator; according to the loss function, training the generated type countermeasure network model by adopting the randomly generated first preset number of noise data and the selected second preset number of real images to obtain a trained generated type countermeasure network model. The method constructs the second discriminant for calculating the similarity between the images, and forms the double discriminant based on the second discriminant for calculating the similarity between the images, so that the training speed of the generated countermeasure network model can be improved, and the quality of image generation can be improved.
According to some embodiments of the invention, the constructing a second arbiter for calculating similarity between images includes:
and calculating the similarity between the images by adopting a twin neural network, and constructing a second discriminator based on the twin neural network.
According to some embodiments of the invention, the loss function of the generated countermeasure network model is constructed by:
Figure BDA0003914373720000021
wherein G denotes the generator, D denotes the first arbiter, S denotes the second arbiter, and x denotes the slave real data field p data W represents the first real image selected from the real data field p data In the generator, G (z) represents the generated image of the generator, E represents the expected, z represents the noise data, p z (z) represents a first predetermined number of noise data randomly generated.
According to some embodiments of the present invention, the training the generated countermeasure network model using the randomly generated first preset number of noise data and the selected second preset number of real images to obtain a trained generated countermeasure network model includes:
presetting a plurality of batches of training, and for each batch of training, performing the following operations:
randomly generating a first preset number of noise data, and inputting the noise data into the generator to obtain noise sample data;
selecting a second preset number of first real images from the real data field, and training the first discriminator by adopting the first real images and the noise sample data;
selecting a second real image, the number of which is the same as that of the first real image, from the real data field, taking the first real image and the second real image as a first group of data, taking the first real image and the noise sample data as a second group of data, and training the second discriminator according to the first group of data and the second group of data;
after the first and second discriminators are trained, inputting the noise data into the generator for training, so that the generator generates images in directions of D (G (z)) -1 and S (G (z), x) -1;
and obtaining a trained generated type countermeasure network model until all batches of training are completed.
According to some embodiments of the invention, the objective function of the twin neural network comprises:
Figure BDA0003914373720000031
wherein N represents the number of samples, X 1 ,X 2 Representing two images, y=1 representing that the two images are similar, y=0 representing that the two images are dissimilar, E w Representing the distance between the two images, m representing a preset threshold.
According to some embodiments of the invention, the training the generated challenge network model includes:
minimizing log (1-D (G (z))) +1-S (G (z), x), D (G (z)) when training a generator, D (z)) when maximized representing that the generated image of the generator is considered a true image, and a larger S (G (z), x) represents that the generated image of the generator is more similar to the true image;
in training the two discriminators, log (1-D (G (z))) +1-S (G (z), x), D (G (z)) being maximized, D (z)) being minimized indicates that the generated image of the generator is considered to be a real image, and smaller S (G (z), x) indicates that the generated image of the generator is more similar to the real image.
In a second aspect, an embodiment of the present invention further provides a system for building a dual-arbiter-generated countermeasure network model, where the system for building a dual-arbiter-generated countermeasure network model includes:
the first discriminator constructing module is used for constructing a first discriminator for discriminating the authenticity of the image;
the second discriminator constructing module is used for constructing a second discriminator for calculating the similarity between the images;
the model building module is used for building a generated type countermeasure network model of the double discriminators and a loss function of the generated type countermeasure network model based on the generator, the first discriminator and the second discriminator;
and the model training module is used for training the generated type countermeasure network model by adopting the randomly generated first preset number of noise data and the selected second preset number of real images according to the loss function to obtain a trained generated type countermeasure network model.
According to some embodiments of the invention, the model training module comprises a sample data acquisition unit, a first discriminant training unit, a second discriminant training unit, and a generator training unit, wherein:
the sample data acquisition unit is used for randomly generating a first preset number of noise data, inputting the noise data into the generator and obtaining noise sample data;
the first discriminant training unit is used for selecting a second preset number of first real images from the real data field and training the first discriminant by adopting the first real images and the noise sample data;
the second discriminant training unit is used for selecting second real images, the number of which is the same as that of the first real images, from the real data field, taking the first real images and the second real images as a first group of data, taking the first real images and the noise sample data as a second group of data, and training the second discriminant according to the first group of data and the second group of data;
the generator training unit is used for inputting the noise data into the generator for training after the first and second discriminants are trained, so that the generator generates pictures towards the directions of D (G (z)) -1 and S (G (z), x) -1.
In a third aspect, an embodiment of the present invention further provides a device for building a dual arbiter-generated countermeasure network model, including at least one control processor and a memory communicatively coupled to the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform a method of building a dual arbiter generated countermeasure network model as described above.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform a method of constructing a dual-discriminant generation type countermeasure network model as described above.
It is to be understood that the advantages of the second to fourth aspects compared with the related art are the same as those of the first aspect compared with the related art, and reference may be made to the related description in the first aspect, which is not repeated herein.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and may be better understood from the following description of embodiments taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of a method of building a dual arbiter-generated challenge network model according to one embodiment of the present invention;
FIG. 2 is a block diagram of a dual arbiter-generated challenge network model according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of a comparison of generated images of a conventional GAN network and a GAN network incorporating similarity calculation according to an embodiment of the present invention;
FIG. 4 is a diagram of the variation of the acceptance Score of a conventional GAN network and a GAN network incorporating similarity calculation according to an embodiment of the present invention;
FIG. 5 is a block diagram of a system for building a dual arbiter-generated challenge network model according to one embodiment of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
In the description of the present invention, the description of first, second, etc. is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, it should be understood that the direction or positional relationship indicated with respect to the description of the orientation, such as up, down, etc., is based on the direction or positional relationship shown in the drawings, is merely for convenience of describing the present invention and simplifying the description, and does not indicate or imply that the apparatus or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
In the description of the present invention, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present invention can be determined reasonably by a person skilled in the art in combination with the specific content of the technical solution.
First, several nouns referred to in this application are parsed:
twin neural network: the deep learning network is proposed by Chopra S et al in 2005, the input of the network is two pictures with the same size, and the output is the similarity of the two pictures. The structure of the twin neural network is shown in fig. 2, where two input pictures of the twin neural network first pass through a convolution layer in which weights are shared. After passing through the convolution layer, the output of the two pictures is respectively connected by using a full connection layer, and the characteristics of the pictures are extracted. And calculating the distance (such as Euclidean distance) between the pictures through the features of the images, and finally judging the similarity between the two pictures through a full-connection layer by using a sigmoid activation function. The similarity degree between two pictures can be well calculated through the twin neural network.
The generation of a countermeasure network (GAN) by Ian j. Goodfellow et al in 2014 proposes that the application has achieved tremendous success in the fields of image generation, image enhancement, and the like. The trained GAN network can be well fitted with the distribution of real data, so that a large number of artificial pictures are generated, and the problem of insufficient data volume in the application of real deep learning is solved. Therefore, GAN has great research significance and application value.
However GAN networks also have significant drawbacks. The first and the traditional GAN discriminators can only judge the authenticity of the pictures, and transmit the information to the generator for parameter optimization. However, this information is very limited and therefore the training process of GAN networks tends to be very lengthy. In addition, GAN training is unstable and is often prone to pattern collapse and gradient extinction. Second, there is a great deal of effort to constrain GAN using image similarity calculations so that the generator generates better quality images and mitigates the risk of pattern collapse. Most, however, measure similarity between two images by calculating image spatial distance or feature distance. The method of measuring distance through image space (such as Euclidean distance) is the most common method for calculating the similarity of two images, however, the algorithms have poor effect in calculating the image distance of high-dimensional space.
In order to solve the problems, the invention improves the training speed of a generated type countermeasure network model and the quality of image generation, and constructs a first discriminator for discriminating the authenticity of the image; constructing a second discriminator for calculating the similarity between the images; constructing a generated type countermeasure network model of the double discriminators and a loss function of the generated type countermeasure network model based on the generator, the first discriminator and the second discriminator; according to the loss function, training the generated type countermeasure network model by adopting the randomly generated first preset number of noise data and the selected second preset number of real images to obtain a trained generated type countermeasure network model. The invention constructs the second discriminant for calculating the similarity between the images, and forms the double discriminant based on the second discriminant for calculating the similarity between the images, thereby improving the training speed of the generated countermeasure network model and improving the quality of image generation.
Referring to fig. 1 to 2, an embodiment of the present invention provides a method for constructing a dual-arbiter-generated countermeasure network model, where the method for constructing a dual-arbiter-generated countermeasure network includes:
step S100, a first discriminator for discriminating the authenticity of the image is constructed.
Specifically, a first discriminator for discriminating the authenticity of the image is constructed. The first Discriminator is a Discriminator for discriminating the authenticity of an image as in the conventional GAN network, and is denoted as D Discriminator (i.e., discriminator in fig. 2) with reference to fig. 2.
Step S200, constructing a second discriminator for calculating the similarity between the images.
Specifically, a second discriminator for calculating the similarity between images is constructed. The second discriminant uses the twin neural network to calculate the similarity between the images, and based on the twin neural network, the second discriminant is constructed, and referring to fig. 2, the second discriminant is labeled as an S-discriminant (i.e., a discriminant S in fig. 2).
The objective function of the twin neural network is as follows:
Figure BDA0003914373720000061
wherein N represents the number of samples, X 1 ,X 2 Representing two images, y=1 representing that the two images are similar, y=0 representing that the two images are dissimilar, E w Representing the distance between the two images, m representing a preset threshold.
When y=1, X is represented 1 ,X 2 The two pictures belong to the same category, and the loss function of the twin neural network at the moment is as follows:
Figure BDA0003914373720000062
the direction of optimization is to minimize the loss function, i.e. minimize
Figure BDA0003914373720000063
Equivalent to optimizing in a direction that minimizes the distance between the two images.
When y=0, X is represented 1 ,X 2 The two images do not belong to the same class, and the loss function of the twin neural network at this time is:
Figure BDA0003914373720000064
optimizing in a direction that minimizes the loss function, i.e. maximizes E w The direction corresponds to a direction in which the distance between the two images is optimally increased. After the twin neural network training is completed, whether the two images belong to the same category or not can be well judged, namely whether the two images are similar or not.
Step S300, constructing a generative countermeasure network model of a dual arbiter and a loss function of the generative countermeasure network model based on the Generator (i.e., the Generator in fig. 2), the first arbiter, and the second arbiter.
Specifically, a generative countermeasure network model of the dual discriminators and a loss function of the generative countermeasure network model are constructed based on the generator, the first discriminator and the second discriminator. The present embodiment constructs a loss function of a generated countermeasure network model by:
Figure BDA0003914373720000071
wherein G represents a generator, D represents a first arbiter, S represents a second arbiter, and x represents a slave real data field p data The first real image selected from w represents the real data field p data In the second real image selected, G (z) represents the generated image of the generator, E represents the expected, z represents the noise data, p z (z) represents a first predetermined number of noise data randomly generated.
In the present embodiment, in the training process of the generated countermeasure network model, the loss function of the generated countermeasure network model is directed to
Figure BDA0003914373720000072
The direction is optimized. The method comprises the following steps:
in training the generator, the objective is to minimize the loss function of the generative countermeasure network model, where the generative countermeasure network model expects D (G (z), x) and S (G (z, x) in the loss function of the generative countermeasure network model to be as large as possible, D (G (z)) being the largest that represents the generated image of the generator as a true image (i.e., true in fig. 2), S (z), x) being the larger that represents the generated image of the generator to be more similar to the true image (i.e., similarity in fig. 2).
In training the two discriminators, the objective is to maximize the loss function of the generative countermeasure network model, where the generative countermeasure network model expects D (x) and S (G (z), x) in the loss function of the generative countermeasure network model to be as large as possible, D (G (z)) and S (G (z), x) to be as small as possible, the smallest D (G (z)) representing that the generated image of the generator is regarded as a true image, and the smaller S (G (z), x) representing that the generated image of the generator is more similar to the true image.
Step 400, training the generated countermeasure network model by adopting a first preset number of randomly generated noise data and a second preset number of selected real images according to the loss function to obtain a trained generated countermeasure network model.
Specifically, training of a plurality of batches is preset, and for each batch of training, the following operations are performed:
randomly generating a first preset number of noise data (i.e., noise in fig. 2), and inputting the noise data into a generator to obtain noise sample data (i.e., gen imgs in fig. 2);
selecting a second preset number of first real images (i.e., wire imgs1 in fig. 2) from the real data field, and training a first arbiter using the first real images and noise sample data;
selecting a second real image (i.e., wire imgs2 in fig. 2) from the real data field, which is the same in number as the first real image, using the first real image and the second real image as a first set of data, and using the first real image and noise sample data as a second set of data, training a second arbiter according to the first set of data and the second set of data;
after the first and second discriminators are trained, inputting noise data into a generator for training so that the generator generates images in directions of D (G (z)) -1 and S (G (z), x) -1;
and obtaining a trained generated type countermeasure network model until all batches of training are completed. For example:
training of the generated challenge network model will be learned in the form of small batches of samples, assuming a batch size of n for each training.
In each batch of training, two discriminators will first be trained. M pieces of noise data { z }, which are to be randomly generated 1 ,…,z m Inputting into a generator to generate m noise sample data G (z) through a neural network;
from the real data field p data Selecting m first real images { x }, among 1 ,…x m Inputting the first discriminant D and G (z) together, and optimizing the first discriminant D in the direction of maximizing the loss function until the loss function of the generated countermeasure network model is maximized;
then from the real data field p data M second real images { w }, are selected 1 ,…w m Inputting { w, x } and { w, G (z) } into the second discriminant S for training until the loss function of the generated type countermeasure network model is maximized;
the generator is trained after the two discriminant training is completed, with the goal of inputting noise data z into the generator G such that D (G (z))→1 and S (G (z), x) →1.
After the above training, the generator will generate better quality pictures, and the first and second discriminators D and S will have better discrimination ability for the images. The cycle is that the discriminator and the generator learn each other and grow each other, and finally the generator can generate very realistic images after training is completed.
It should be noted that, in this embodiment, the first preset number, the second preset number, and the preset number of training sets may be changed according to actual needs, and the embodiment is not limited specifically.
In this embodiment, the second discriminant for calculating the similarity between the images is constructed, and the double discriminants are formed based on the second discriminant for calculating the similarity between the images, so that the training speed of the generated countermeasure network model can be improved, and the quality of image generation can be improved.
For better illustration, the present example was analyzed as follows:
since the method proposed in the present embodiment is a general method, the technical solution of the present embodiment can be introduced into almost all mainstream GAN networks. This example describes the baseline and most advanced methods used in the comparison during the course of the experiment. In this example, five models, i.e., conventional GAN, DCGAN (Deep Convolutional Generative Adversarial Networks), CGAN (Conditional Generative Adversarial Nets), ACGAN (auxiliary class GAN), and LSGAN (Least Squares Generative Adversarial Networks), were selected as reference methods for experiments. In addition, SCGAN (shape-consistent generative adversarial network) and DEGAN (A Conditional Generative Adversarial Network for Document Enhancement) methods were introduced as SOTA (state-of-the-art) methods for comparative experiments. The algorithm of SCGAN is used in semi-supervised learning, and the embodiment adds a similarity constraint algorithm part referring to the SCGAN into the SOTA model and makes a comparison experiment with the technical scheme of the embodiment. The experimental group is the technical scheme of the embodiment, while the control group is GAN without similarity calculation.
A large number of experiments prove that the technical scheme of the embodiment has obvious improvement in convergence rate and generated image quality compared with the traditional single-discriminant GAN. Before training, super parameters (such as learning rate, batch size and the like) of the neural network are uniformly set, so that a single variable is ensured.
To compare performance between two networks, model parameters were saved every 500 batches trained during the experiment, and the acceptance Score (IS) of the current model was calculated, which IS a measure of the quality of the GAN generated image. It measures the quality and diversity of GAN-generated images, with higher IS scores representing better quality GAN-generated images. Comparing the IS scores of the two networks after training IS completed, comparing the quality of the images generated by the networks, drawing an IS score change graph, and observing the change condition of the network scores in the training process.
Table 1 shows IS scores after training of a conventional GAN and its variants with the GAN after introducing similarity calculations, all hyper-parameters are the same during network training, where data represents the dataset and Epoch represents the number of training batch iterations in training. It can be found that the GAN (technical solution of this embodiment) after the similarity analysis is introduced has better performance, and the quality of the generated image is better than that of the conventional GAN.
TABLE 1
Figure BDA0003914373720000091
Referring to fig. 3, fig. 3 is a comparative schematic diagram of generated images of a conventional GAN network and a GAN network introduced with the technical scheme of the present embodiment, wherein fig. (a) and (b) are images generated after 30000 batches of learning of the GAN and the conventional GAN introduced with the technical scheme of the present embodiment, fig. c and (d) are images generated after 100 batches of learning of the DCGAN and the original DCGAN introduced with the technical scheme of the present embodiment, and fig. e and (f) are graphs of results of training 50 batches of the LSGAN network and the original LSGAN network on a CIFAR-10 dataset, and fig. g and (h) are images generated after 50 batches of training of the ACGAN and the original DCGAN introduced with the technical scheme of the present embodiment.
Compared with the traditional GAN training method, the GAN (technical scheme of the embodiment) after similarity calculation is introduced has higher convergence speed in the training process, and the generator can learn the distribution domain of the real image more quickly. In this embodiment, the convergence rate of the network IS shown by observing the change condition of the network IS Score, and referring to fig. 4, fig. 4 shows the convergence rate of each network in the training process, where epchos represents the number of training batch iterations in training, blue: raw GAN model (i.e., the dark line in fig. 4) represents the network model without introducing the technical solution of this embodiment, and yellow: new GAN model (i.e., the light line in fig. 4) represents the network model with introducing the technical solution of this embodiment. The method comprises the following steps:
fig. 4 IS a diagram showing the variation of the Index Score (IS) value of the conventional GAN network and the GAN network introducing the similarity calculation in the training process (the technical solution of the present embodiment), in which fig. a IS a diagram showing the comparison of the IS Score between the GAN network and the GAN network introducing the technical solution of the present embodiment, fig. b IS a diagram showing the comparison of the IS Score between the conventional CGAN network and the CGAN network introducing the technical solution of the present embodiment, and fig. c IS a diagram showing the comparison of the IS Score between the DCGAN network and the DCGAN network introducing the technical solution of the present embodiment. As can be seen from fig. 4, the technical solution in this embodiment can bring about a better effect.
Referring to fig. 5, the embodiment of the present invention further provides a system for building a dual-arbiter-generated countermeasure network model, which includes a first arbiter building module 100, a second arbiter building module 200, a model building module 300, and a model training module 400, wherein:
a first discriminator constructing module 100 for constructing a first discriminator for discriminating the authenticity of the image;
a second arbiter construction module 200 for constructing a second arbiter for calculating the similarity between the images;
the model building module 300 is configured to build a generated type countermeasure network model of the dual discriminators and a loss function of the generated type countermeasure network model based on the generator, the first discriminator and the second discriminator;
the model training module 400 is configured to train the generated type countermeasure network model by using the randomly generated first preset number of noise data and the selected second preset number of real images according to the loss function, so as to obtain a trained generated type countermeasure network model.
In some embodiments, the model training module includes a sample data acquisition unit, a first discriminant training unit, a second discriminant training unit, and a generator training unit, wherein:
the sample data acquisition unit is used for randomly generating a first preset number of noise data, inputting the noise data into the generator and obtaining noise sample data;
the first discriminator training unit is used for selecting a second preset number of first real images from the real data domain and training the first discriminator by adopting the first real images and noise sample data;
a second discriminant training unit for selecting second real images of the same number as the first real images from the real data domain, using the first real images and the second real images as a first set of data, and using the first real images and noise sample data as a second set of data, and training a second discriminant according to the first set of data and the second set of data;
and the generator training unit is used for inputting the noise data into the generator for training after the first and second discriminators are trained, so that the generator generates pictures towards the directions of D (G (z)) -1 and S (G (z), x) -1.
It should be noted that, since the system for constructing a dual-discriminant generation type countermeasure network model in the present embodiment and the method for constructing a dual-discriminant generation type countermeasure network model described above are based on the same inventive concept, the corresponding content in the method embodiment is also applicable to the system embodiment, and will not be described in detail here.
The embodiment of the invention also provides a construction device of the dual-discriminant generation type countermeasure network model, which comprises: at least one control processor and a memory for communication connection with the at least one control processor.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
A non-transitory software program and instructions required to implement the method of constructing a dual-discriminant-generated countermeasure network model of the above-described embodiment are stored in a memory, and when executed by a processor, the method of constructing a dual-discriminant-generated countermeasure network model of the above-described embodiment is performed, for example, the method steps S100 to S400 in fig. 1 described above are performed.
The system embodiments described above are merely illustrative, in that the units illustrated as separate components may or may not be physically separate, i.e., may be located in one place, or may be distributed over a plurality of network elements. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions that are executed by one or more control processors to cause the one or more control processors to perform a method for building a dual-arbiter-generated-type countermeasure network model in the method embodiment described above, for example, to perform the functions of the method steps S100 to S400 in fig. 1 described above.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
While the preferred embodiments of the present application have been described in detail, the embodiments are not limited to the above-described embodiments, and various equivalent modifications and substitutions can be made by those skilled in the art without departing from the spirit of the embodiments, and these equivalent modifications and substitutions are intended to be included in the scope of the embodiments of the present application as defined in the appended claims.

Claims (10)

1. The construction method of the double-discriminant generation type countermeasure network model is characterized by comprising the following steps of:
constructing a first discriminator for discriminating the authenticity of the image;
constructing a second discriminator for calculating the similarity between the images;
constructing a generated countermeasure network model of a double discriminator and a loss function of the generated countermeasure network model based on a generator, the first discriminator and the second discriminator;
and training the generated countermeasure network model by adopting a first preset number of randomly generated noise data and a second preset number of selected real images according to the loss function to obtain a trained generated countermeasure network model.
2. The method of constructing a dual arbiter-generated countermeasure network model according to claim 1, wherein the constructing a second arbiter for calculating a similarity between images includes:
and calculating the similarity between the images by adopting a twin neural network, and constructing a second discriminator based on the twin neural network.
3. The method of constructing a dual arbiter-generated countermeasure network model of claim 1, wherein the loss function of the generated countermeasure network model is constructed by:
Figure FDA0003914373710000011
wherein G denotes the generator, D denotes the first arbiter, S denotes the second arbiter, and x denotes the slave real data field p da t a W represents the first real image selected from the real data field p data In the generator, G (z) represents the generated image of the generator, E represents the expected, z represents the noise data, p z (z) represents a first predetermined number of noise data randomly generated.
4. The method for building a dual-discriminant generative countermeasure network model of claim 3, wherein said training said generative countermeasure network model with a first predetermined number of randomly generated noise data and a second predetermined number of selected real images to obtain a trained generative countermeasure network model comprises:
presetting a plurality of batches of training, and for each batch of training, performing the following operations:
randomly generating a first preset number of noise data, and inputting the noise data into the generator to obtain noise sample data;
selecting a second preset number of first real images from the real data field, and training the first discriminator by adopting the first real images and the noise sample data;
selecting a second real image, the number of which is the same as that of the first real image, from the real data field, taking the first real image and the second real image as a first group of data, taking the first real image and the noise sample data as a second group of data, and training the second discriminator according to the first group of data and the second group of data;
after the first and second discriminators are trained, inputting the noise data into the generator for training, so that the generator generates images in directions of D (G (z)) -1 and S (G (z), x) -1;
and obtaining a trained generated type countermeasure network model until all batches of training are completed.
5. The method of constructing a dual arbiter-generated challenge network model of claim 2, wherein the objective function of the twin neural network comprises:
Figure FDA0003914373710000021
wherein N represents the number of samples, X 1 ,X 2 Representing two images, y=1 representing that the two images are similar, y=0 representing that the two images are dissimilar, E w Representing the distance between the two images, m representing a preset threshold.
6. A method of constructing a dual arbiter-generated countermeasure network model of claim 3, wherein the training of the generated countermeasure network model comprises:
minimizing log (1-D (G (z))) +1-S (G (z), x), D (G (z)) when training a generator, D (z)) when maximized representing that the generated image of the generator is considered a true image, and a larger S (G (z), x) represents that the generated image of the generator is more similar to the true image;
in training the two discriminators, log (1-D (G (z))) +1-S (G (z), x), D (G (z)) being maximized, D (z)) being minimized indicates that the generated image of the generator is considered to be a real image, and smaller S (G (z), x) indicates that the generated image of the generator is more similar to the real image.
7. A system for building a dual-arbiter-generated countermeasure network model, the system comprising:
the first discriminator constructing module is used for constructing a first discriminator for discriminating the authenticity of the image;
the second discriminator constructing module is used for constructing a second discriminator for calculating the similarity between the images;
the model building module is used for building a generated type countermeasure network model of the double discriminators and a loss function of the generated type countermeasure network model based on the generator, the first discriminator and the second discriminator;
and the model training module is used for training the generated type countermeasure network model by adopting the randomly generated first preset number of noise data and the selected second preset number of real images according to the loss function to obtain a trained generated type countermeasure network model.
8. The system for building a dual arbiter-generated countermeasure network model of claim 7, wherein the model training module comprises a sample data acquisition unit, a first arbiter training unit, a second arbiter training unit, and a generator training unit, wherein:
the sample data acquisition unit is used for randomly generating a first preset number of noise data, inputting the noise data into the generator and obtaining noise sample data;
the first discriminant training unit is used for selecting a second preset number of first real images from the real data field and training the first discriminant by adopting the first real images and the noise sample data;
the second discriminant training unit is used for selecting second real images, the number of which is the same as that of the first real images, from the real data field, taking the first real images and the second real images as a first group of data, taking the first real images and the noise sample data as a second group of data, and training the second discriminant according to the first group of data and the second group of data;
the generator training unit is used for inputting the noise data into the generator for training after the first and second discriminants are trained, so that the generator generates pictures towards the directions of D (G (z)) -1 and S (G (z), x) -1.
9. A dual arbiter-generated construction apparatus for an antagonistic network model, comprising at least one control processor and a memory for communicative connection with the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform the method of constructing a dual arbiter generation type countermeasure network model according to any one of claims 1 to 6.
10. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method of constructing a dual-discriminant generation type countermeasure network model according to any one of claims 1 to 6.
CN202211333154.3A 2022-10-28 2022-10-28 Construction method and system of dual-discriminant generation type countermeasure network model Pending CN116091884A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211333154.3A CN116091884A (en) 2022-10-28 2022-10-28 Construction method and system of dual-discriminant generation type countermeasure network model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211333154.3A CN116091884A (en) 2022-10-28 2022-10-28 Construction method and system of dual-discriminant generation type countermeasure network model

Publications (1)

Publication Number Publication Date
CN116091884A true CN116091884A (en) 2023-05-09

Family

ID=86205271

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211333154.3A Pending CN116091884A (en) 2022-10-28 2022-10-28 Construction method and system of dual-discriminant generation type countermeasure network model

Country Status (1)

Country Link
CN (1) CN116091884A (en)

Similar Documents

Publication Publication Date Title
US11893781B2 (en) Dual deep learning architecture for machine-learning systems
WO2022121289A1 (en) Methods and systems for mining minority-class data samples for training neural network
US10956779B2 (en) Multi-distance clustering
CN109271958B (en) Face age identification method and device
CN110799995A (en) Data recognizer training method, data recognizer training device, program, and training method
CN109886343B (en) Image classification method and device, equipment and storage medium
CN112784929B (en) Small sample image classification method and device based on double-element group expansion
Zhai et al. Generative adversarial networks as variational training of energy based models
KR102203252B1 (en) Method and system for collaborative filtering based on generative adversarial networks
CN113378959B (en) Zero sample learning method for generating countermeasure network based on semantic error correction
CN111046178B (en) Text sequence generation method and system
Chen et al. An effective feature selection scheme for healthcare data classification using binary particle swarm optimization
Wehenkel et al. Diffusion priors in variational autoencoders
WO2018036547A1 (en) Data processing method and device thereof
CN113868366A (en) Streaming data-oriented online cross-modal retrieval method and system
CN113505855A (en) Training method for anti-attack model
CN111008940B (en) Image enhancement method and device
CN116776948A (en) Federal learning method, system and medium based on customer selection and weight distribution
CN116091884A (en) Construction method and system of dual-discriminant generation type countermeasure network model
CN116543259A (en) Deep classification network noise label modeling and correcting method, system and storage medium
US20240020531A1 (en) System and Method for Transforming a Trained Artificial Intelligence Model Into a Trustworthy Artificial Intelligence Model
Tan et al. Calibrated adversarial algorithms for generative modelling
CN110459266B (en) Method for establishing SNP (Single nucleotide polymorphism) pathogenic factor and disease association relation model
CN110443344B (en) Momentum wheel fault diagnosis method and device based on K2ABC algorithm
CN117557870B (en) Classification model training method and system based on federal learning client selection

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