CN109903242A - A kind of image generating method and device - Google Patents
A kind of image generating method and device Download PDFInfo
- Publication number
- CN109903242A CN109903242A CN201910103228.6A CN201910103228A CN109903242A CN 109903242 A CN109903242 A CN 109903242A CN 201910103228 A CN201910103228 A CN 201910103228A CN 109903242 A CN109903242 A CN 109903242A
- Authority
- CN
- China
- Prior art keywords
- generation
- model
- sample image
- numerical value
- differentiation
- 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
Links
Landscapes
- Image Analysis (AREA)
Abstract
The present invention relates to machine learning techniques, a kind of image generating method and device are provided, to improve the data distribution range of sample image, this method are as follows: in such a way that generation model and judgment models are relatively anti-, it continues on judgment models and identifies the false sample image that generation model is generated based on noise data, network parameter is generated to promote to generate model successive optimization, to upgrade false sample image step by step, ultimately generate the false sample image that judgment models are difficult to, in this way, the generation model that can be obtained using final training, magnanimity false sample image true to nature is generated based on noise data, since noise data can be with cover all kinds practical application scene, therefore, the false sample image ultimately generated can satisfy data distribution range requirement, and it can be used for training image identification model, and then can effectively it expand The application range of image recognition model is opened up, and can accurately promote the image recognition precision of image recognition model.
Description
Technical field
The present invention relates to machine learning techniques, in particular to a kind of image generating method and device.
Background technique
It is widely applied currently, image recognition technology has been obtained in smart home field.Under normal conditions, in order to mention
Image recognition precision is risen, pattern recognition device needs to acquire the sample image of magnanimity, is trained to image recognition model.In order to
The identification precision for improving image recognition model generally requires the coverage area for expanding sample image, i.e., to original sample graph
As carrying out various transformation, e.g., rotation, reflection, overturning, scaling, translation, change of scale, contrast variation, noise disturbance, color
Variation, regional blacking etc..
However, being expanded using existing way to sample image, only operated, is opened up in laboratory environment
Exhibition result is not still able to satisfy the demand of practical application, that is, the data distribution range of the sample image after expanding still extremely has
Limit.Scene in many actual application environments still can not cover, e.g., overexposure, mirror-reflection etc..
Accordingly, it is desirable to provide a kind of new image generating method, to overcome drawbacks described above.
Summary of the invention
The embodiment of the present invention provides a kind of image generating method and device, to improve the data distribution model of sample image
It encloses.
Specific technical solution provided in an embodiment of the present invention is as follows:
A kind of image generating method, comprising:
Acquisition noise data, and recycle the following operation of execution, until determine generate prediction numerical value reach set threshold value as
Only:
Sampling noise is extracted from the noise data, and deconvolution behaviour is carried out to the sampling noise by generating network
Make, generates false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and numerical value is predicted based on the generation
And the generating probability value error between setting numerical value is generated, generate the corresponding generational loss function of the generation model;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the life for generating model
It is updated at network parameter.
The generation model that latest update obtains is exported, and by the generation model, specifies application scenarios based on characterizing
Noise data generates corresponding false sample image.
Optionally, before obtaining noise data, further comprise:
Capturing sample image generates corresponding training data set;
Circulation executes following operation, until determining differentiate whether the value of probability value error is historical low value, and differentiates
Until accuracy rate is historic high:
A sample image is chosen in the training data set, and the sample image is rolled up using discrimination model
Product operation calculates corresponding differentiation prediction numerical value;
The corresponding differentiation probability value error differentiated between prediction numerical value and differentiation actual value of the sample image is calculated,
And according to probability value error is differentiated, the corresponding differentiation loss function of the discrimination model is calculated;
Judge whether the value for differentiating probability value error is historical low value, and differentiates that accuracy rate is historical high
Value, when being judged as NO, is updated the differentiation network parameter of the discrimination model;
Export the discrimination model that latest update obtains.
Optionally, according to probability value error is differentiated, the corresponding differentiation loss function of the discrimination model is calculated, comprising:
Obtain the corresponding differentiation differentiated between prediction numerical value and differentiation actual value of the sample image being currently generated
Probability value error, the sample image are authentic specimen image or false sample image;
It obtains the corresponding differentiation prediction numerical value of other sample images generated in history and differentiates sentencing between actual value
Other probability value error, other described sample images are authentic specimen image or/and false sample image;
Sentenced described in calculating based on acquired all differentiation probability value errors in conjunction with the differentiation network parameter being currently generated
The corresponding differentiation loss function of other model.
Optionally, the differentiation network parameter of the discrimination model is updated, comprising:
The differentiation network parameter of the discrimination model is carried out using gradient rise method based on the differentiation loss function
It updates, wherein described to differentiate that network parameter includes the whole weights and bias in the discrimination model.
Optionally, based on the generating probability value error generated between prediction numerical value and generation setting numerical value, institute is generated
It states and generates the corresponding generational loss function of model, comprising:
It obtains the corresponding generation prediction numerical value of the falseness sample image being currently generated and generates between setting numerical value
Generating probability value error;
It obtains the corresponding generation prediction numerical value of other falseness sample images generated in history and generates between setting numerical value
Generating probability value error;
The life is calculated in conjunction with the generation network parameter being currently generated based on acquired all generating probability value errors
At the corresponding generational loss function of model.
Optionally, the generation network parameter for generating model is updated, comprising:
The generation network parameter for generating model is carried out using gradient descent method based on the generational loss function
It updates, wherein the network parameter that generates includes the whole weights and bias in the generation model.
Optionally, it is being updated to the generation network parameter for generating model based on the generational loss function
Before, further comprise:
The fixed differentiation network parameter for differentiating that network is currently used, pause update the differentiation network ginseng for differentiating network
Number.
A kind of image processing apparatus, comprising:
Training unit is used for acquisition noise data, and recycles the following operation of execution, reaches until determining and generating prediction numerical value
Until setting threshold value:
Sampling noise is extracted from the noise data, and deconvolution behaviour is carried out to the sampling noise by generating network
Make, generates false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and numerical value is predicted based on the generation
And the generating probability value error between setting numerical value is generated, generate the corresponding generational loss function of the generation model;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the life for generating model
It is updated at network parameter.
Generation unit is referred to for exporting the generation model of latest update acquisition, and by the generation model based on characterization
Determine the noise data of application scenarios, generates corresponding false sample image.
Optionally, before obtaining noise data,
The training unit is further used for:
Capturing sample image generates corresponding training data set;
Circulation executes following operation, until determining differentiate whether the value of probability value error is historical low value, and differentiates
Until accuracy rate is historic high:
A sample image is chosen in the training data set, and the sample image is rolled up using discrimination model
Product operation calculates corresponding differentiation prediction numerical value;
The corresponding differentiation probability value error differentiated between prediction numerical value and differentiation actual value of the sample image is calculated,
And according to probability value error is differentiated, the corresponding differentiation loss function of the discrimination model is calculated;
Judge whether the value for differentiating probability value error is historical low value, and differentiates that accuracy rate is historical high
Value, when being judged as NO, is updated the differentiation network parameter of the discrimination model;The generation unit is further used for:
Export the discrimination model that latest update obtains.
Optionally, according to differentiating probability value error, when calculating the corresponding differentiation loss function of the discrimination model, the instruction
Practice unit to be used for:
Obtain the corresponding differentiation differentiated between prediction numerical value and differentiation actual value of the sample image being currently generated
Probability value error, the sample image are authentic specimen image or false sample image;
It obtains the corresponding differentiation prediction numerical value of other sample images generated in history and differentiates sentencing between actual value
Other probability value error, other described sample images are authentic specimen image or/and false sample image;
Sentenced described in calculating based on acquired all differentiation probability value errors in conjunction with the differentiation network parameter being currently generated
The corresponding differentiation loss function of other model.
Optionally, when being updated to the differentiation network parameter of the discrimination model, the training unit is used for:
The differentiation network parameter of the discrimination model is carried out using gradient rise method based on the differentiation loss function
It updates, wherein described to differentiate that network parameter includes the whole weights and bias in the discrimination model.
Optionally, based on the generating probability value error generated between prediction numerical value and generation setting numerical value, institute is generated
It states when generating the corresponding generational loss function of model, the training unit is used for:
It obtains the corresponding generation prediction numerical value of the falseness sample image being currently generated and generates between setting numerical value
Generating probability value error;
It obtains the corresponding generation prediction numerical value of other falseness sample images generated in history and generates between setting numerical value
Generating probability value error;
The life is calculated in conjunction with the generation network parameter being currently generated based on acquired all generating probability value errors
At the corresponding generational loss function of model.
Optionally, when being updated to the generation network parameter for generating model, the training unit is used for:
The generation network parameter for generating model is carried out using gradient descent method based on the generational loss function
It updates, wherein the network parameter that generates includes the whole weights and bias in the generation model.
Optionally, it is being updated to the generation network parameter for generating model based on the generational loss function
Before, the training unit is further used for:
The fixed differentiation network parameter for differentiating that network is currently used, pause update the differentiation network ginseng for differentiating network
Number.
A kind of storage medium, preserving has program for image generating method, when described program is run by processor, executes
Following steps:
Acquisition noise data, and recycle the following operation of execution, until determine generate prediction numerical value reach set threshold value as
Only:
Sampling noise is extracted from the noise data, and deconvolution behaviour is carried out to the sampling noise by generating network
Make, generates false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and numerical value is predicted based on the generation
And the generating probability value error between setting numerical value is generated, generate the corresponding generational loss function of the generation model;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the life for generating model
It is updated at network parameter.
The generation model that latest update obtains is exported, and by the generation model, specifies application scenarios based on characterizing
Noise data generates corresponding false sample image.
A kind of communication device, including one or more processors;And one or more computer-readable mediums, it is described can
It reads to be stored with instruction on medium, when described instruction is executed by one or more of processors, so that described device execution is above-mentioned
Any one method.
In the embodiment of the present invention, image processing apparatus using generate model and judgment models it is relatively anti-by the way of, constantly make
Identify the false sample image for generating model and generating based on noise data, with judgment models to promote to generate model successive optimization
It generates network parameter, to upgrade false sample image step by step, ultimately generates the false sample that judgment models are difficult to
Image, in this way, the generation model that image processing apparatus can be obtained using final training, generates magnanimity based on noise data and force
Genuine falseness sample image, due to noise data can with cover all kinds practical application scene, the false sample ultimately generated
Image can satisfy data distribution demand, and can be used for training image identification model, and then can effectively expanded images know
The application range of other model, and can accurately promote the image recognition precision of image recognition model.
Detailed description of the invention
Fig. 1 is the flow diagram of training discrimination model in the embodiment of the present invention;
Fig. 2 is the flow diagram for generating model in the embodiment of the present invention using the training of confrontation mode;
Fig. 3 is image processing apparatus illustrative view of functional configuration in the embodiment of the present invention.
Specific embodiment
In order to improve the data distribution range of sample image, in the embodiment of the present invention, video generation device is using generating pair
Anti- mode carrys out the generation model of training image, and so-called generation confrontation mode, that is, uses a generation network and a differentiation mould
Type.Model stochastical sampling from latent space (latent space) is generated to need to imitate as far as possible as input, output result
Authentic specimen in training data set.And the input of discrimination model is then the output of authentic specimen or generation model, purpose
It is to distinguish the output for generating model as far as possible from authentic specimen.And differentiation net will then be cheated as much as possible by generating model
Network.Generate model and discrimination model confront with each other, continuous adjusting parameter, final purpose is to make discrimination model that can not judge to generate mould
Whether the output result of type is true, in this way, can meet data distribution range using the sample image that model generates is generated
Demand, to cover most of scenes in actual application environment.
Further description is made to the preferred embodiment of the present invention with reference to the accompanying drawing.
Firstly, introducing the basic conception for generating model and discrimination model.
Generate model G (Generative model): input initial data generates model G for the initial data of input, turns
Turn to false sample image (the dummy copy picture and the authentic specimen image in training data set of generation that can be mixed the spurious with the genuine
More more similar, better).
Discrimination model D (Discriminative model): (authentic specimen image generates mould to input sample to be tested image
The false sample image that type G is generated), some numerical value between 0-1 is exported, numerical value, which more levels off to, 0 illustrates that sample to be tested image is
A possibility that false sample, is high, and numerical value 1 illustrates that a possibility that sample is truthful data is bigger more leveling off to.
The training process that whole image generates model is divided into two stages.
In first stage, only discrimination model D is participated in.Specifically, by training data set authentic specimen image x with
The not trained input for generating model G falseness sample image z generated as discrimination model D, exports some between 0-1
Data, numerical value means that more greatly a possibility that sample image of input is authentic specimen is bigger, conversely, then explanation is false sample
A possibility that it is bigger.In this process, ideally, the numerical value of discrimination model D output approaches 1, D (x) ≈ 1 as far as possible.
It can be arbitrary two sorter network of down-sampling about the selection of discrimination model D in the embodiment of the present invention.
Specifically, as shown in fig.1, the training process of discrimination model D is specific as follows in the embodiment of the present invention:
Step 100: image processing apparatus capturing sample image generates corresponding training data set.
Optionally, the training data set includes that authentic specimen image (i.e. label=1) and false sample image are (non-
The final image for generating network and generating, i.e., not trained generation model G are generated like sample image, label=0).
Step 110: image processing apparatus inputs current discrimination model in training data set randomly drawing sample image
In D.
Step 120: image processing apparatus carries out a series of convolution behaviour to the sample image by the discrimination model D
Make, numerical value is predicted in the differentiation for obtaining discrimination model D output, is denoted as D (x), wherein the institute for differentiating prediction numerical representation method prediction
Stating sample image is true probability.
Step 130: image processing apparatus calculates the corresponding differentiation prediction numerical value of the sample image and differentiates actual value
Between differentiation probability value error, and according to the differentiation probability value error, letter is lost in the corresponding differentiation of computational discrimination model D
Number, wherein the differentiation actual value indicates that sample image described in reality is true probability.
Specifically, differentiating that probability value error can be expressed as Diff=label-D (x).
In subsequent antagonistic process, objective function corresponding to discrimination model D are as follows:
In practical application, the effect of objective function is one quality of model of measurement or asking for model optimization problem
Solution.
In the embodiment of the present invention, in above-mentioned formula, x expression authentic specimen image, z expression noise data, and G (z) table
Show and generates the false sample image that model G is generated.
D (x) indicates that x belongs to true probability in the case where setting probability distribution, wherein x~Pdata(x) indicate that x belongs to really
Training data, z~Pz(z) indicate that z is derived from the distribution of simulation.
D (x) indicate the whether true probability of sample image (because x be exactly it is true, for discrimination model D,
The value of D (x) is better closer to 1), and D (G (z)) indicates that discrimination model D judgement generates the dummy copy picture z that model G is generated and is
No true probability.
Generate the purpose of model G: the picture " closer to true better " of generation, i.e. the value of D (G (z)) is as big as possible, this
When, V (D, G) can become smaller, and therefore, the mark of the formula foremost of above-mentioned objective function is min_G.
The purpose of discrimination model D: the ability of discrimination model D is stronger, and D's (x) should be bigger, and D (G (z)) should be smaller.This
When V (D, G) can become larger, therefore, the mark before the formula of above-mentioned objective function is max_D.
Based on above-mentioned objective function, primary loss function representation are as follows:
Wherein, xiExpression respectively indicates authentic specimen image, ziIndicate noise data.
It is not directly in above-mentioned optimization aim directly against differentiation during hands-on in the embodiment of the present invention
The differentiation network parameter θ of modeldCalculate gradient, θdSo that D (x) is as close possible to label (0 or 1).Specifically, being segmented into several
A step recycles k times, prepares one group of authentic specimen image x=x every time1,x2,...,xmWith one group of noise data z=z1,
z2,...,zm, calculate this differentiation loss function:
Wherein, xiExpression respectively indicates the authentic specimen image chosen from training data set, ziIndicate noise data, D
(x) the whether true probability of sample image x is indicated, i.e., numerical value is predicted in above-mentioned differentiation, and D (G (z)) indicates discrimination model D judgement
Generate the whether true probability of false sample image z that model G is generated.
Due to needing to input authentic specimen image and the falseness in training data set in the training process of discrimination model D
Sample image, in this way, discrimination model D could accurately determine which be authentic specimen, which be false sample;Therefore, in life
When at differentiating loss function, calculating the corresponding differentiation prediction numerical value of the sample image and differentiating that the differentiation between actual value is general
When rate value error, differentiates probable error, can be the corresponding differentiation probable error of authentic specimen image, be also possible to false sample
The corresponding differentiation probable error of image.
Step 140: image processing apparatus judges whether the value for differentiating probability value error is historical low value, and sentences
Other accuracy rate is historic high, if so, thening follow the steps 150;Otherwise, return step 160.
Step 150: the differentiation network D that the current training of image processing apparatus output obtains is as final goal.
Step 160: image processing apparatus is according to the differentiation loss function, using back-propagation algorithm, to discrimination model D
Differentiation network parameter be updated, return step 110.
It is so-called that differentiation network parameter is updated, it is using gradient rise method to θdIt is updated.In so-called gradient
The method of liter refers to: gradient rise method is a kind of algorithm of the local maximum found a function, and iterative process is one " upward slope "
Process, each step selection maximum direction of change of slope are up walked, this direction is exactly gradient direction of the function in this point,
Finally with iterations going on, gradient or constantly reduction, finally approach and zero.Gradient rise method uses in calculating process
Gradient of the mode computational discrimination loss function of error back propagation to whole weights and bias, wherein the whole weight
It is above-mentioned differentiation network parameter with bias.
In second stage, discrimination model D and generation model G are involved in.Mould is generated specifically, first inputting noise data z
Type G generates model G and combines the probability distribution learnt in truthful data set, generates corresponding false sample image, then will
False sample image inputs discrimination model D, and discrimination model D output numerical value 0, i.e. identification will generate model D input as far as possible
Image is false sample image.In this process, discrimination model D is equivalent to two classifiers in the case of a supervision, input
Sample image otherwise be classified as 1 or be classified as 0, i.e., it is either true or false.And network is generated, it can choose up-sampling network.
Specifically, as shown in fig.2, the training process for generating model G is specific as follows in the embodiment of the present invention:
Step 200: image processing apparatus acquisition noise data.
Noise data can cover the noise under any scene, e.g., overexposure, mirror-reflection etc..
Step 210: image processing apparatus randomly selects sampling noise in the noise data, is input to current generation
In model G.
Step 220: image processing apparatus carries out a series of deconvolution operation to sampling noise by generating network G, raw
At false sample image, it is denoted as G (z).
For example, it is assumed that the picture element matrix of original image image of sampling noise is 3X3, firstly, using up-sampling mode by original image
Image becomes the intermediate image of 7X7, it can be seen that compared to original image image, the more pixels of many blank of intermediate image.So
Afterwards, the convolution kernel for reusing a 3X3 carries out the convolution operation that sliding step is 1 to intermediate image, obtains the falseness of a 5X5
Sample image.Expand original image image using up-sampling mode, deconvolution filling intermediate image content is reused, so that ultimately generating
The content of false sample image become abundant.
Step 230: false sample image G (z) is input in discrimination model D by image processing apparatus, obtains discrimination model D
Numerical value D (z) is predicted in the generation of output, wherein the false sample image for generating prediction numerical representation method prediction is true
Probability.
In the embodiment of the present invention, the label of false sample image can be disposed as 1 by image processing apparatus, that is, can be considered
All false sample images that image processing apparatus default generates are true, and above-mentioned label is alternatively referred to as false sample
The generation of image sets numerical value.
Step 240: image processing apparatus calculates the corresponding generation prediction numerical value of the noise data and generates setting numerical value
Between generating probability value error calculate and generate the corresponding generational loss letter of model G and according to the generating probability value error
Number, wherein the generation sets the specified false sample image of numerical representation method as true probability.
Specifically, generating probability value error can be expressed as Diff=label-D (G (z)).
In the embodiment of the present invention, generating model G, there is no an independent objective functions, therefore, generate the parameter of model G
When (e.g., gradient) is updated, source is the gradient of demand of the discrimination model D to image is forged, and is forged in setting
In the case that the lable of image is 1, keep differentiating that network D is constant, then differentiating the gradient of demand of the network D to picture is forged
It is exactly the direction changed towards true picture.
Similarly, primary loss function representation are as follows:
Wherein, xiExpression respectively indicates authentic specimen image, ziIndicate noise data.
It is not directly in above-mentioned optimization aim directly against θ during hands-on in the embodiment of the present inventiongMeter
Gradient is calculated, and is divided into several steps, is recycled k times, prepares one group of noise data z=z every time1,z2,...,zm, calculate this
Generational loss function:
Due to this training, input data is to generate network G false sample image generated, so loss function is
Following formula:
Wherein, ziIndicate noise data, and D (G (z)) indicates that discrimination model D judgement generates the false sample that model G is generated
Numerical value is predicted in the whether true probability of image, i.e., above-mentioned generation.
Does step 250: image processing apparatus judge that the generation prediction numerical value reaches setting threshold value? step is executed if
Rapid 260;Otherwise, step 270 is executed.
Step 260: the currently trained generation network G of image processing apparatus output is as final goal.
So far, the generation model G that image processing apparatus can be obtained using newest training, is based on noise data, generates foot
That enough mixes the spurious with the genuine covers the fault image of ideal data distribution, is based on such fault image, and image processing apparatus can train
High-precision image recognition model is generated to mention so as to effectively improve image recognition precision in all kinds of actual application environments
Hi-vision recognition efficiency.
Step 270: the fixed generation network parameter for differentiating that network D is currently used of image processing apparatus, pause differentiate network D
Generation network parameter update.
Differentiate that above-mentioned generating probability error amount is sent to generation network G by network D in this way, can enable, thus more newly-generated
The generation network parameter of network G.
Certainly, stop updating if having differentiated network D, step 250 can not also be executed.
When generation prediction numerical value is lower than setting threshold value, i.e. about >=0.5, i.e. characterization discrimination model can not area by D (z)
Divide authentic specimen image distribution and generate the false sample image distribution that model G is generated based on noise data, then at this point, terminating to instruct
Practice process, obtains final generation model G.
Step 280: image processing apparatus is according to the generational loss function, using back-propagation algorithm, to generation model G
Generation network parameter be updated, then, return step 210.
Specifically, be by generating probability value error differentiated network D anti-pass retrogradation in network G, it is more newly-generated with this
The generation network parameter of network G;For example, optional, image processing apparatus can update θ using gradient descent methodg。
So-called gradient descent method refers to: gradient descent method is a kind of algorithm of the local minimum found a function, iteration
Process is the process of one " descending ", and each step selection maximum direction of change of slope is walked downward, this direction is exactly function
In the gradient direction of this point, finally with iterations going on, gradient or constantly reduction are finally approached and zero.Gradient decline
Method calculates generational loss function to the ladder of whole weights and bias in calculating process by the way of error back propagation
Degree, wherein it is described whole weights and bias be i.e. above-mentioned generation network parameter.
Based on the above embodiment, it as shown in fig.3, the embodiment of the present invention provides a kind of image processing apparatus, includes at least
Training unit 30 and generation unit 31, wherein
Training unit 30 is used for acquisition noise data, and recycles the following operation of execution, reaches until determining and generating prediction numerical value
Until setting threshold value:
Sampling noise is extracted from the noise data, and deconvolution behaviour is carried out to the sampling noise by generating network
Make, generates false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and numerical value is predicted based on the generation
And the generating probability value error between setting numerical value is generated, generate the corresponding generational loss function of the generation model;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the life for generating model
It is updated at network parameter.
Generation unit 31, for exporting the generation model of latest update acquisition, and by the generation model, based on characterization
The noise data of specified application scenarios generates corresponding false sample image.
Optionally, before obtaining noise data,
The training unit 30 is further used for:
Capturing sample image generates corresponding training data set;
Circulation executes following operation, until determining differentiate whether the value of probability value error is historical low value, and differentiates
Until accuracy rate is historic high:
A sample image is chosen in the training data set, and the sample image is rolled up using discrimination model
Product operation calculates corresponding differentiation prediction numerical value;
The corresponding differentiation probability value error differentiated between prediction numerical value and differentiation actual value of the sample image is calculated,
And according to probability value error is differentiated, the corresponding differentiation loss function of the discrimination model is calculated;
Judge whether the value for differentiating probability value error is historical low value, and differentiates that accuracy rate is historical high
Value, when being judged as NO, is updated the differentiation network parameter of the discrimination model;
The generation unit 31 is further used for:
Export the discrimination model that latest update obtains.
Optionally, according to differentiating probability value error, when calculating the corresponding differentiation loss function of the discrimination model, the instruction
Practice unit 30 to be used for:
Obtain the corresponding differentiation differentiated between prediction numerical value and differentiation actual value of the sample image being currently generated
Probability value error, the sample image are authentic specimen image or false sample image;
It obtains the corresponding differentiation prediction numerical value of other sample images generated in history and differentiates sentencing between actual value
Other probability value error, other described sample images are authentic specimen image or/and false sample image;
Sentenced described in calculating based on acquired all differentiation probability value errors in conjunction with the differentiation network parameter being currently generated
The corresponding differentiation loss function of other model.
Optionally, when being updated to the differentiation network parameter of the discrimination model, the training unit 30 is used for:
The differentiation network parameter of the discrimination model is carried out using gradient rise method based on the differentiation loss function
It updates, wherein described to differentiate that network parameter includes the whole weights and bias in the discrimination model.
Optionally, based on the generating probability value error generated between prediction numerical value and generation setting numerical value, institute is generated
It states when generating the corresponding generational loss function of model, the training unit 30 is used for:
It obtains the corresponding generation prediction numerical value of the falseness sample image being currently generated and generates between setting numerical value
Generating probability value error;
It obtains the corresponding generation prediction numerical value of other falseness sample images generated in history and generates between setting numerical value
Generating probability value error;
The life is calculated in conjunction with the generation network parameter being currently generated based on acquired all generating probability value errors
At the corresponding generational loss function of model.
Optionally, when being updated to the generation network parameter for generating model, the training unit 30 is used for:
The generation network parameter for generating model is carried out using gradient descent method based on the generational loss function
It updates, wherein the network parameter that generates includes the whole weights and bias in the generation model.
Optionally, it is being updated to the generation network parameter for generating model based on the generational loss function
Before, the training unit 30 is further used for:
The fixed differentiation network parameter for differentiating that network is currently used, pause update the differentiation network ginseng for differentiating network
Number.
Based on the same inventive concept, the embodiment of the present invention provides a kind of storage medium, preserves for image generating method
There is program, when described program is run by processor, execute following steps:
Acquisition noise data, and recycle the following operation of execution, until determine generate prediction numerical value reach set threshold value as
Only:
Sampling noise is extracted from the noise data, and deconvolution behaviour is carried out to the sampling noise by generating network
Make, generates false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and numerical value is predicted based on the generation
And the generating probability value error between setting numerical value is generated, generate the corresponding generational loss function of the generation model;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the life for generating model
It is updated at network parameter.
The generation model that latest update obtains is exported, and by the generation model, specifies application scenarios based on characterizing
Noise data generates corresponding false sample image.
Based on the same inventive concept, the embodiment of the present invention provides a kind of communication device, including one or more processors;With
And one or more computer-readable mediums, instruction is stored on the readable medium, and described instruction is one or more of
When processor executes, so that described device executes any one of the above method.
In conclusion in the embodiment of the present invention, the image processing apparatus side relatively anti-using generation model and judgment models
Formula continues on judgment models and identifies the false sample image that generation model is generated based on noise data, to promote to generate mould
Type successive optimization generates network parameter, to upgrade false sample image step by step, ultimately generates what judgment models were difficult to
False sample image, in this way, the generation model that image processing apparatus can be obtained using final training, raw based on noise data
At the false sample image that magnanimity is true to nature, due to noise data can with cover all kinds practical application scene, ultimately generate
False sample image can satisfy data distribution demand, and can be used for training image identification model, and then can effectively expand
The application range of image recognition model is opened up, and can accurately promote the image recognition precision of image recognition model.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, those skilled in the art can carry out various modification and variations without departing from this hair to the embodiment of the present invention
The spirit and scope of bright embodiment.In this way, if these modifications and variations of the embodiment of the present invention belong to the claims in the present invention
And its within the scope of equivalent technologies, then the present invention is also intended to include these modifications and variations.
Claims (10)
1. a kind of image generating method characterized by comprising
Acquisition noise data, and the following operation of execution is recycled, until determining that generating prediction numerical value reaches setting threshold value:
Sampling noise is extracted from the noise data, and deconvolution operation is carried out to the sampling noise by generating network, it is raw
At false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and based on generation prediction numerical value and life
At the generating probability value error between setting numerical value, the corresponding generational loss function of the generation model is generated;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the generation net for generating model
Network parameter is updated;
The generation model that latest update obtains is exported, and by the generation model, based on the noise for characterizing specified application scenarios
Data generate corresponding false sample image.
2. the method as described in claim 1, which is characterized in that before obtaining noise data, further comprise:
Capturing sample image generates corresponding training data set;
Circulation operates below executing, and until determining differentiate whether the value of probability value error is historical low value, and differentiates accurately
Until rate is historic high:
A sample image is chosen in the training data set, and convolution behaviour is carried out to the sample image using discrimination model
Make, calculates corresponding differentiation prediction numerical value;
Calculate the corresponding differentiation probability value error differentiated between prediction numerical value and differentiation actual value of the sample image, and root
According to probability value error is differentiated, the corresponding differentiation loss function of the discrimination model is calculated;
Judge whether the value for differentiating probability value error is historical low value, and differentiate that accuracy rate is historic high, sentences
Break when being no, the differentiation network parameter of the discrimination model is updated;
Export the discrimination model that latest update obtains.
3. method according to claim 2, which is characterized in that according to probability value error is differentiated, calculate the discrimination model pair
The differentiation loss function answered, comprising:
Obtain the corresponding differentiation probability differentiated between prediction numerical value and differentiation actual value of the sample image being currently generated
It is worth error, the sample image is authentic specimen image or false sample image;
It obtains the corresponding differentiation prediction numerical value of other sample images generated in history and differentiates that the differentiation between actual value is general
Rate value error, other described sample images are authentic specimen image or/and false sample image;
The differentiation mould is calculated in conjunction with the differentiation network parameter being currently generated based on acquired all differentiation probability value errors
The corresponding differentiation loss function of type.
4. method according to claim 2, which is characterized in that the differentiation network parameter of the discrimination model is updated,
Include:
The differentiation network parameter of the discrimination model is updated using gradient rise method based on the differentiation loss function,
Wherein, described to differentiate that network parameter includes the whole weights and bias in the discrimination model.
5. method according to any of claims 1-4, which is characterized in that predict that numerical value and generation are set based on the generation
Generating probability value error between fixed number value generates the corresponding generational loss function of the generation model, comprising:
Obtain the corresponding generation generated between prediction numerical value and generation setting numerical value of the false sample image being currently generated
Probability value error;
Obtain the corresponding life generated between prediction numerical value and generation setting numerical value of other the false sample images generated in history
At probability value error;
The generation mould is calculated in conjunction with the generation network parameter being currently generated based on acquired all generating probability value errors
The corresponding generational loss function of type.
6. method as claimed in claim 5, which is characterized in that the generation network parameter for generating model is updated,
Include:
The generation network parameter for generating model is updated using gradient descent method based on the generational loss function,
Wherein, the network parameter that generates includes the whole weights and bias in the generation model.
7. method as claimed in claim 5, which is characterized in that generating model to described based on the generational loss function
Before generation network parameter is updated, further comprise:
The fixed differentiation network parameter for differentiating that network is currently used, pause update the differentiation network parameter for differentiating network.
8. a kind of image processing apparatus characterized by comprising
Training unit is used for acquisition noise data, and recycles the following operation of execution, reaches setting until determining and generating prediction numerical value
Until threshold value:
Sampling noise is extracted from the noise data, and deconvolution operation is carried out to the sampling noise by generating network, it is raw
At false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and based on generation prediction numerical value and life
At the generating probability value error between setting numerical value, the corresponding generational loss function of the generation model is generated;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the generation net for generating model
Network parameter is updated;
Generation unit is specified based on characterization and is answered for exporting the generation model of latest update acquisition, and by the generation model
With the noise data of scene, corresponding false sample image is generated.
9. a kind of storage medium, preserving has program for image generating method, which is characterized in that described program is transported by processor
When row, following steps are executed:
Acquisition noise data, and the following operation of execution is recycled, until determining that generating prediction numerical value reaches setting threshold value:
Sampling noise is extracted from the noise data, and deconvolution operation is carried out to the sampling noise by generating network, it is raw
At false sample image;
Numerical value is predicted using the generation that discrimination model calculates the false sample image, and based on generation prediction numerical value and life
At the generating probability value error between setting numerical value, the corresponding generational loss function of the generation model is generated;
Do you judge that the generation prediction numerical value reaches setting threshold value? when being judged as NO, to the generation net for generating model
Network parameter is updated;
The generation model that latest update obtains is exported, and by the generation model, based on the noise for characterizing specified application scenarios
Data generate corresponding false sample image.
10. a kind of communication device, which is characterized in that including one or more processors;And it is one or more computer-readable
Medium is stored with instruction on the readable medium, when described instruction is executed by one or more of processors, so that the dress
Set the method executed as described in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910103228.6A CN109903242A (en) | 2019-02-01 | 2019-02-01 | A kind of image generating method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910103228.6A CN109903242A (en) | 2019-02-01 | 2019-02-01 | A kind of image generating method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109903242A true CN109903242A (en) | 2019-06-18 |
Family
ID=66944707
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910103228.6A Pending CN109903242A (en) | 2019-02-01 | 2019-02-01 | A kind of image generating method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109903242A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110321849A (en) * | 2019-07-05 | 2019-10-11 | 腾讯科技(深圳)有限公司 | Image processing method, device and computer readable storage medium |
CN110401488A (en) * | 2019-07-12 | 2019-11-01 | 北京邮电大学 | A kind of demodulation method and device |
CN111915701A (en) * | 2020-08-17 | 2020-11-10 | 腾讯科技(上海)有限公司 | Button image generation method and device based on artificial intelligence |
CN112949384A (en) * | 2021-01-23 | 2021-06-11 | 西北工业大学 | Remote sensing image scene classification method based on antagonistic feature extraction |
CN113065635A (en) * | 2021-02-27 | 2021-07-02 | 华为技术有限公司 | Model training method, image enhancement method and device |
CN113627576A (en) * | 2021-10-08 | 2021-11-09 | 平安科技(深圳)有限公司 | Code scanning information detection method, device, equipment and storage medium |
US11403487B2 (en) | 2020-09-29 | 2022-08-02 | Alipay (Hangzhou) Information Technology Co., Ltd. | Enhanced training method and apparatus for image recognition model |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107016406A (en) * | 2017-02-24 | 2017-08-04 | 中国科学院合肥物质科学研究院 | The pest and disease damage image generating method of network is resisted based on production |
CN107358626A (en) * | 2017-07-17 | 2017-11-17 | 清华大学深圳研究生院 | A kind of method that confrontation network calculations parallax is generated using condition |
CN107909621A (en) * | 2017-11-16 | 2018-04-13 | 深圳市唯特视科技有限公司 | It is a kind of based on it is twin into confrontation network medical image synthetic method |
CN108197525A (en) * | 2017-11-20 | 2018-06-22 | 中国科学院自动化研究所 | Face image synthesis method and device |
CN109190684A (en) * | 2018-08-15 | 2019-01-11 | 西安电子科技大学 | SAR image sample generating method based on sketch and structural generation confrontation network |
-
2019
- 2019-02-01 CN CN201910103228.6A patent/CN109903242A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107016406A (en) * | 2017-02-24 | 2017-08-04 | 中国科学院合肥物质科学研究院 | The pest and disease damage image generating method of network is resisted based on production |
CN107358626A (en) * | 2017-07-17 | 2017-11-17 | 清华大学深圳研究生院 | A kind of method that confrontation network calculations parallax is generated using condition |
CN107909621A (en) * | 2017-11-16 | 2018-04-13 | 深圳市唯特视科技有限公司 | It is a kind of based on it is twin into confrontation network medical image synthetic method |
CN108197525A (en) * | 2017-11-20 | 2018-06-22 | 中国科学院自动化研究所 | Face image synthesis method and device |
CN109190684A (en) * | 2018-08-15 | 2019-01-11 | 西安电子科技大学 | SAR image sample generating method based on sketch and structural generation confrontation network |
Non-Patent Citations (1)
Title |
---|
IAN J. GOODFELLOW: "Generative Adversarial Nets", 《ARXIV:1406.2661V1》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110321849A (en) * | 2019-07-05 | 2019-10-11 | 腾讯科技(深圳)有限公司 | Image processing method, device and computer readable storage medium |
CN110321849B (en) * | 2019-07-05 | 2023-12-22 | 腾讯科技(深圳)有限公司 | Image data processing method, device and computer readable storage medium |
CN110401488A (en) * | 2019-07-12 | 2019-11-01 | 北京邮电大学 | A kind of demodulation method and device |
CN111915701A (en) * | 2020-08-17 | 2020-11-10 | 腾讯科技(上海)有限公司 | Button image generation method and device based on artificial intelligence |
CN111915701B (en) * | 2020-08-17 | 2023-08-22 | 腾讯科技(上海)有限公司 | Button image generation method and device based on artificial intelligence |
US11403487B2 (en) | 2020-09-29 | 2022-08-02 | Alipay (Hangzhou) Information Technology Co., Ltd. | Enhanced training method and apparatus for image recognition model |
TWI777536B (en) * | 2020-09-29 | 2022-09-11 | 大陸商支付寶(杭州)信息技術有限公司 | Enhanced training method and device for image recognition model |
CN112949384A (en) * | 2021-01-23 | 2021-06-11 | 西北工业大学 | Remote sensing image scene classification method based on antagonistic feature extraction |
CN112949384B (en) * | 2021-01-23 | 2024-03-08 | 西北工业大学 | Remote sensing image scene classification method based on antagonistic feature extraction |
CN113065635A (en) * | 2021-02-27 | 2021-07-02 | 华为技术有限公司 | Model training method, image enhancement method and device |
CN113627576A (en) * | 2021-10-08 | 2021-11-09 | 平安科技(深圳)有限公司 | Code scanning information detection method, device, equipment and storage medium |
CN113627576B (en) * | 2021-10-08 | 2022-01-18 | 平安科技(深圳)有限公司 | Code scanning information detection method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109903242A (en) | A kind of image generating method and device | |
CN111310808B (en) | Training method and device for picture recognition model, computer system and storage medium | |
CN108090470B (en) | Face alignment method and device | |
CN109300530B (en) | Pathological picture identification method and device | |
CN108388925A (en) | The anti-pattern collapse robust image generation method for generating network is fought based on New Conditions | |
CN108257121B (en) | Method, apparatus, storage medium and the terminal device that product defects detection model updates | |
CN110211097A (en) | Crack image detection method based on fast R-CNN parameter migration | |
CN108009509A (en) | Vehicle target detection method | |
CN108230359A (en) | Object detection method and device, training method, electronic equipment, program and medium | |
CN108681689B (en) | Frame rate enhanced gait recognition method and device based on generation of confrontation network | |
CN111914944A (en) | Object detection method and system based on dynamic sample selection and loss consistency | |
CN109711283A (en) | A kind of joint doubledictionary and error matrix block Expression Recognition algorithm | |
CN110516677A (en) | A kind of neural network recognization model, target identification method and system | |
CN113901977A (en) | Deep learning-based power consumer electricity stealing identification method and system | |
CN110909657A (en) | Method for identifying apparent tunnel disease image | |
CN109740609A (en) | A kind of gauge detection method and device | |
CN112990480A (en) | Method and device for building model, electronic equipment and storage medium | |
CN114972882A (en) | Wear surface damage depth estimation method and system based on multi-attention machine system | |
CN104978569A (en) | Sparse representation based incremental face recognition method | |
CN113223098B (en) | Preprocessing optimization method for image color classification | |
CN109934352B (en) | Automatic evolution method of intelligent model | |
CN111368837A (en) | Image quality evaluation method and device, electronic equipment and storage medium | |
CN107729918A (en) | Cellular automata based on Cost Sensitive Support Vector Machines emerges in large numbers the sorting technique of phenomenon | |
US11755688B2 (en) | Apparatus and method for generating training data for a machine learning system | |
CN112076463B (en) | Lightweight method for mobile phone game |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190618 |
|
RJ01 | Rejection of invention patent application after publication |