CN111027603B - Image generation method for improving GAN model - Google Patents
Image generation method for improving GAN model Download PDFInfo
- Publication number
- CN111027603B CN111027603B CN201911181133.2A CN201911181133A CN111027603B CN 111027603 B CN111027603 B CN 111027603B CN 201911181133 A CN201911181133 A CN 201911181133A CN 111027603 B CN111027603 B CN 111027603B
- Authority
- CN
- China
- Prior art keywords
- model
- sample
- improved
- generated
- generation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses an image generation method for improving a GAN model, which comprises the steps of firstly reading a local existing original image sample; pre-training an improved LeNet model; taking the improved LeNet model as a discrimination model of the improved GAN model; designing a generation model of an improved GAN model according to the generation model of the original GAN model; taking random noise as input of a generation model, and obtaining a generated image sample after deconvolution operation; taking the generated image sample and the existing original image sample as the input of the discrimination model to obtain the probability that the picture is true, and returning the result to the discrimination model in the step 3 and the generation model in the step 4; judging the model updating parameters to better distinguish the truth of the picture, and generating a model to generate a more real picture; and (4) the generated model and the discrimination model compete with each other and are mutually promoted, the training is finished after N steps, and finally the generated model generates a real sample. The invention not only can save cost for manufacturers, but also can provide more samples for subsequent classification problems.
Description
Technical Field
The invention belongs to the technical field of image processing, relates to an image generation method, and particularly relates to an image generation method for improving a GAN (generic image warping) model.
Background
When the classification problem on the production line is processed, the number of samples provided by manufacturers is limited, and in order to increase the characteristics of the samples and improve the stability of the classification model, pictures need to be generated according to the existing samples.
At present, the GAN model is widely applied to image generation, but the problems of model collapse and difficult model training exist.
Disclosure of Invention
In order to solve the technical problem, the invention provides an image generation method for improving a GAN model by combining an improved LeNet model and the GAN model.
The technical scheme adopted by the invention is as follows: an image generation method for improving a GAN model is characterized by comprising the following steps:
step 1: reading a local original image sample;
step 2: pre-training an improved LeNet model;
and step 3: taking the improved LeNet model as a discrimination model of the improved GAN model;
and 4, step 4: designing a generation model of an improved GAN model according to the generation model of the original GAN model;
and 5: taking random noise as input of a generation model, and obtaining a generated image sample after deconvolution operation;
step 6: taking the generated image sample and the existing original image sample as the input of the discrimination model to obtain the probability that the picture is true, and returning the result to the discrimination model in the step 3 and the generation model in the step 4;
updating and judging model parameters by using a gradient ascending algorithm, wherein the parameters are weights of the convolution layers of each layer, distinguishing true and false of the picture, and generating a model to generate a more real picture;
and 7: and (4) the generated model and the discrimination model compete with each other and are mutually promoted, the training is finished after N steps, and finally the generated model generates a real sample.
Preferably, the improved LeNet model in step 2 is composed of 3 groups of same modules, each group of module structure includes 2 3 × 3 convolutions and one 1 × 1 convolution, each convolution needs to be subjected to normalization processing and relu activation function activation, then 3 convolution operations are subjected to residual error processing, and finally 2 × 2 pooling operation is connected.
Preferably, the pre-trained improved LeNet model in step 2 is trained by using a convolutional neural network training method to improve parameters of the LeNet model, where the parameters include weights of convolutional layers of the improved LeNet, and an obtained effect is that each weight reaches an optimal value so that the model can determine whether the picture is true or false.
Preferably, the generated model of the improved GAN model in step 4 includes 4 sets of the same modules, each set of modules includes 5 × 5 deconvolution and 1 × 1 convolution, and each deconvolution and convolution is then activated by a normalization process and a relu activation function.
Preferably, the generating model and the discriminating model in step 7 compete with each other and promote each other, and the specific implementation process is as follows: firstly, a generation model G receives random noise Z and generates a false sample; then, the generated sample and the original real sample are used as input of a discrimination model D to judge whether the sample is true or false; returning the result to G and D to enable the two models, wherein G generates a new batch of samples to deceive D, and D updates parameters to more accurately distinguish true from false; the two network models promote updating mutually until the generated sample D and the real sample have the same distribution, and G cannot distinguish the true and false of the generated sample and the real sample.
The invention provides an improved GAN by combining the improved LeNet and the GAN and provides a training method for generating pictures after classification, thereby not only saving the cost for manufacturers, but also providing more samples for subsequent classification problems.
Drawings
FIG. 1 is a flow chart of an embodiment of the present invention;
FIG. 2 is a diagram of a decision model according to an embodiment of the present invention;
FIG. 3 is a diagram of a generation model according to an embodiment of the present invention.
Detailed Description
In order to facilitate the understanding and implementation of the present invention for those of ordinary skill in the art, the present invention is further described in detail with reference to the accompanying drawings and examples, it is to be understood that the embodiments described herein are merely illustrative and explanatory of the present invention and are not restrictive thereof.
Referring to fig. 1, the image generation method for improving a GAN model provided by the present invention includes the following steps:
step 1: reading 5000 original image samples of local pictures, wherein the original image samples comprise two categories, such as crayfish: one is bads (black and damaged shrimp, etc.) and the other is goods (good lobster), with corresponding labels 0 and 1;
step 2: 5000 samples are used as input of an improved LeNet model, and model parameters are trained by a convolutional neural network training method.
The improved LeNet model of the embodiment is composed of 3 groups of same modules, each group of module structures comprises 2 3 × 3 convolutions and 1 × 1 convolution, each convolution needs to be subjected to normalization processing and relu activation function activation, then 3 convolution operations are subjected to residual error processing, and finally 2 × 2 pooling operations are connected.
The whole model inputs pictures, and the probability of judging whether the pictures are true or false is finally output after the pictures pass through the 3 groups of modules.
And step 3: the pre-trained improved LeNet model is used as a discrimination model of the improved GAN model, and the model is shown in figure 2.
The pre-training improved LeNet model of the embodiment trains parameters of the improved LeNet model by a convolutional neural network training method, wherein the parameters comprise weights of convolutional layers of the improved LeNet, and the obtained effect is that the weights reach an optimal value so that the model can judge whether a picture is true or false.
And 4, step 4: and designing a generation model of the improved GAN model according to the generation model of the original GAN model, wherein the model is shown in figure 3.
The generated model of the improved GAN model of the embodiment includes 4 sets of the same modules, each set of the modules includes 5 × 5 deconvolution and 1 × 1 convolution, and each deconvolution and convolution is then subjected to normalization processing and relu activation function activation.
The whole model is input with random noise, then full connection operation is carried out, activation is carried out through BN (normalization processing) and relu activation function, and then the picture is output through the operation of the 4 modules.
And 5: and (4) taking random noise as an input of a generation model, and performing operations such as deconvolution to obtain a generated image sample.
Step 6: taking the generated image sample and the existing original image sample as the input of the discrimination model to obtain the probability that the picture is true, and returning the result to the discrimination model in the step 3 and the generation model in the step 4;
in the embodiment, a gradient ascent algorithm is used for updating and distinguishing model parameters, wherein the parameters are weights of convolution layers of each layer, the truth of a picture is distinguished, and a model is generated to generate a more real picture;
and 7: the two models compete with each other and promote each other, the training 20000 steps are finished, and finally the generated model can generate a real sample.
In this embodiment, the generation model and the discrimination model compete with each other and promote each other, and the specific implementation process is as follows: firstly, a generation model G receives random noise Z and generates a false sample; then, the generated sample and the original real sample are used as input of a discrimination model D to judge whether the sample is true or false; returning the result to G and D to enable the two models, wherein G generates a new batch of samples to deceive D, and D updates parameters to more accurately distinguish true from false; the two network models promote updating mutually until the generated sample D and the real sample have the same distribution, and G cannot distinguish the true and false of the generated sample and the real sample.
It should be understood that the above description of the preferred embodiments is given for clarity and not for any purpose of limitation, and that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (2)
1. An image generation method for improving a GAN model is characterized by comprising the following steps:
step 1: reading a local original image sample;
step 2: pre-training an improved LeNet model;
the improved LeNet model consists of 3 groups of same modules, each group of module structure comprises 2 3 × 3 convolutions and 1 × 1 convolution, each convolution needs to be subjected to normalization processing and relu activation function activation, then 3 convolution operations are subjected to residual error processing, and finally 2 × 2 pooling operation is connected;
and step 3: taking the improved LeNet model as a discrimination model of the improved GAN model;
and 4, step 4: designing a generation model of an improved GAN model according to the generation model of the original GAN model;
the generation model of the improved GAN model comprises 4 groups of same modules, wherein each group of modules comprises 5 × 5 deconvolution and 1 × 1 convolution, and each deconvolution and convolution is subjected to normalization processing and relu activation function activation;
and 5: taking random noise as input of a generation model, and obtaining a generated image sample after deconvolution operation;
step 6: taking the generated image sample and the existing original image sample as input of a discrimination model to obtain the probability that the picture is true, and returning the result to the discrimination model in the step 3 and the generation model in the step 4;
updating and judging model parameters by using a gradient ascending algorithm, wherein the parameters are weights of the convolution layers of each layer, distinguishing true and false of the picture, and generating a model to generate a more real picture;
and 7: the generated model and the discrimination model compete with each other and are mutually promoted, training is finished after N steps, and finally the generated model generates a real sample;
the generation model and the discrimination model compete with each other and promote each other, and the specific implementation process is as follows: firstly, a generation model G receives random noise Z and generates a false sample; then, the generated sample and the original real sample are used as input of a discrimination model D to judge whether the sample is true or false; returning the result to G and D to enable the two models, wherein G generates a new batch of samples to deceive D, and D updates parameters to more accurately distinguish true from false; the two network models promote updating mutually until the generated sample D and the real sample have the same distribution, and G cannot distinguish the true and false of the generated sample and the real sample.
2. The method of generating an image of an improved GAN model as claimed in claim 1, wherein: the pre-training improved LeNet model in the step 2 is specifically realized by the following steps: training parameters of an improved LeNet model by a convolutional neural network training method, wherein the parameters comprise the weight of each convolutional layer of the improved LeNet, and the obtained effect is that each weight reaches an optimal value so that the model can judge whether the picture is true or false.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911181133.2A CN111027603B (en) | 2019-11-27 | 2019-11-27 | Image generation method for improving GAN model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911181133.2A CN111027603B (en) | 2019-11-27 | 2019-11-27 | Image generation method for improving GAN model |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111027603A CN111027603A (en) | 2020-04-17 |
CN111027603B true CN111027603B (en) | 2022-07-05 |
Family
ID=70202510
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911181133.2A Active CN111027603B (en) | 2019-11-27 | 2019-11-27 | Image generation method for improving GAN model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111027603B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107273978A (en) * | 2017-05-25 | 2017-10-20 | 清华大学 | A kind of production of three models game resists the method for building up and device of network model |
CN107403200A (en) * | 2017-08-10 | 2017-11-28 | 北京亚鸿世纪科技发展有限公司 | Improve the multiple imperfect picture sorting technique of image segmentation algorithm combination deep learning |
CN108537742A (en) * | 2018-03-09 | 2018-09-14 | 天津大学 | A kind of panchromatic sharpening method of remote sensing images based on generation confrontation network |
WO2018189728A1 (en) * | 2017-04-14 | 2018-10-18 | Cerebras Systems Inc. | Floating-point unit stochastic rounding for accelerated deep learning |
CN109816030A (en) * | 2019-01-30 | 2019-05-28 | 河南科技大学 | A kind of image classification method and device based on limited Boltzmann machine |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101565931B1 (en) * | 2008-11-03 | 2015-11-06 | 삼성전자주식회사 | Photoelectric conversion film photoelectric conversion Device and color image sensor hanving the photoelelctric conversion film |
-
2019
- 2019-11-27 CN CN201911181133.2A patent/CN111027603B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018189728A1 (en) * | 2017-04-14 | 2018-10-18 | Cerebras Systems Inc. | Floating-point unit stochastic rounding for accelerated deep learning |
CN107273978A (en) * | 2017-05-25 | 2017-10-20 | 清华大学 | A kind of production of three models game resists the method for building up and device of network model |
CN107403200A (en) * | 2017-08-10 | 2017-11-28 | 北京亚鸿世纪科技发展有限公司 | Improve the multiple imperfect picture sorting technique of image segmentation algorithm combination deep learning |
CN108537742A (en) * | 2018-03-09 | 2018-09-14 | 天津大学 | A kind of panchromatic sharpening method of remote sensing images based on generation confrontation network |
CN109816030A (en) * | 2019-01-30 | 2019-05-28 | 河南科技大学 | A kind of image classification method and device based on limited Boltzmann machine |
Also Published As
Publication number | Publication date |
---|---|
CN111027603A (en) | 2020-04-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108665005B (en) | Method for improving CNN-based image recognition performance by using DCGAN | |
CN108334936B (en) | Fault prediction method based on migration convolutional neural network | |
CN111161207B (en) | Integrated convolutional neural network fabric defect classification method | |
CN111006865A (en) | Motor bearing fault diagnosis method | |
CN111507182B (en) | Skeleton point fusion cyclic cavity convolution-based littering behavior detection method | |
CN108958217A (en) | A kind of CAN bus message method for detecting abnormality based on deep learning | |
CN105528638A (en) | Method for grey correlation analysis method to determine number of hidden layer characteristic graphs of convolutional neural network | |
CN116258707A (en) | PCB surface defect detection method based on improved YOLOv5 algorithm | |
CN112766315B (en) | Method and system for testing robustness of artificial intelligence model | |
CN111783841A (en) | Garbage classification method, system and medium based on transfer learning and model fusion | |
CN116458894B (en) | Electrocardiosignal enhancement and classification method based on composite generation countermeasure network | |
CN114022586B (en) | Defect image generation method based on countermeasure generation network | |
CN112884059A (en) | Small sample radar working mode classification method fusing priori knowledge | |
CN112288714B (en) | Hardware Trojan horse detection method based on deep learning | |
CN110245602A (en) | A kind of underwater quiet target identification method based on depth convolution feature | |
CN113569881A (en) | Self-adaptive semantic segmentation method based on chain residual error and attention mechanism | |
CN111931601A (en) | System and method for correcting error class label of gear box | |
CN112668698A (en) | Neural network training method and system | |
CN111368648B (en) | Individual identification method and device for radar radiation source, electronic equipment and storage medium thereof | |
CN113109782B (en) | Classification method directly applied to radar radiation source amplitude sequence | |
CN111027603B (en) | Image generation method for improving GAN model | |
CN112862094A (en) | DRBM (distributed resource management protocol) fast adaptation method based on meta-learning | |
CN117456230A (en) | Data classification method, system and electronic equipment | |
CN117058716A (en) | Cross-domain behavior recognition method and device based on image pre-fusion | |
CN114663658B (en) | Small sample AOI surface defect detection method with cross-domain migration capability |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |