Image restoration system based on recurrent deep convolutional generative adversarial network structure
The image repair system generates an adversarial network structure through circular deep convolution, and combines the convolutional neural network and the deconvolution network to solve the problem of poor image repair effects in the existing technology and achieve more efficient image feature recovery and repair effects. .
Patent Information
- Application Number
- CN202210553812.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-05-19
AI Technical Summary
The existing technology is not effective in image restoration, especially in preprocessing such as image deblurring, fog removal, and rain removal, and it is difficult to effectively restore image feature information.
An image restoration system based on the cyclic deep convolutional generative adversarial network (CDCGAN) structure is adopted, including the first and second generators, the first and second discriminators, and the network parameters are optimized through cyclic generation network structure and feature extraction, combined with convolution Neural networks and deconvolution networks use strided convolution and LEAKRELU activation functions to achieve multi-level fusion and repair of image features.
The accuracy and effect of image repair are significantly improved, making the repaired image closer to the characteristic information of the original image sample, and enhancing the stability and learning ability of the model.
Smart Images

Figure CN114943655B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image restoration system based on a cyclic deep convolution generative adversarial network structure. Background Art
[0002] With the continuous innovation and development of deep learning technology, deep learning has been widely used in the field of artificial intelligence, giving rise to a large number of new network structures and algorithms, generative adversarial networks being one of them.
[0003] Generative adversarial networks, or GANs, can play a big role in image reconstruction and restoration. Considering that when doing image research, in order to improve the accuracy of research results, image samples are generally preprocessed appropriately before the experiment, such as image deblurring, image restoration of local occlusion, image defogging and deraining, etc. Although there are many algorithms for handling these situations, the results are not necessarily very good. Summary of the invention
[0004] In view of the defects in the prior art and combining the advantages of generative adversarial networks in image reconstruction and restoration, the purpose of the present invention is to provide an image restoration method based on the CDCGAN network structure.
[0005] The image restoration system based on the cyclic deep convolution generative adversarial network structure provided by the present invention includes the following modules:
[0006] A first generator, used to repair the input image sample to generate a repaired image;
[0007] A first discriminator is used to compare the repaired image with a preset target image to determine a first similarity between the repaired image and the preset target image, and then determine whether the first similarity reaches a preset first similarity threshold;
[0008] A second generator, connected to the output end of the first generator, for restoring the repaired image to generate a restored image;
[0009] The second discriminator is used to compare the restored image with the image sample to determine a second similarity between the restored image and the image sample, and then determine whether the second similarity reaches a preset second similarity threshold.
[0010] Preferably, when the first discriminator determines that the first similarity reaches a preset first similarity threshold, the restoration of the image sample is completed;
[0011] When the first discriminator determines that the first similarity does not reach the preset first similarity threshold, the image sample is input into the first generator again.
[0012] Preferably, when the second discriminator determines that the second similarity reaches a preset second similarity threshold, the network parameters of the second generator are saved;
[0013] When the second discriminator determines that the second similarity does not reach the preset second similarity threshold, the image sample is input into the first generator again.
[0014] Preferably, the first generator, the first discriminator, the second generator and the second discriminator form a cyclic generation network structure;
[0015] The cyclically generated network structure is used to continuously optimize and update network parameters, so that the restored image can have more image feature information of the image samples.
[0016] Preferably, the first generator and the second generator use the resnet50 network as the backbone network to extract features from the input image.
[0017] Preferably, the first discriminator and the second discriminator adopt a fully convolutional neural network.
[0018] Preferably, the first generator and the second generator adopt a method of using a convolutional network in conjunction with a deconvolutional network;
[0019] The convolution network is used to extract features from image samples; the deconvolution network is used to reconstruct and repair images based on feature vectors extracted by the convolution network.
[0020] Preferably, the first generator and the second generator are provided with a jump connection structure, and the jump connection structure is used to perform channel splicing on the feature maps obtained by the downsampling of the generator and the corresponding upsampling, so as to realize the effective fusion of multi-level features of the image.
[0021] Preferably, the network structures of the generator and the discriminator are designed by the following method:
[0022] S1: The pooling layer in the convolutional neural network structure is replaced by a convolutional layer. For the discriminator, the stride convolution is used to replace the pooling layer, and for the generator, the fractional stride convolution is used to replace the pooling. The stride convolution is used for spatial downsampling in the discriminator.
[0023] S2: remove the fully connected layer;
[0024] S3: Set up batch normalization;
[0025] S4: Setting an activation function. The generator and the discriminator use different activation functions. A RELU function is set in the generator. The output layer of the generator is set with a tanh function. All layers in the discriminator use a LEAKRELU function.
[0026] Preferably, the loss functions of the generator and the discriminator are:
[0027]
[0028] Among them, z represents the image to be processed, x represents the target image, G1(z i ) represents the repaired image generated by the first generator, G2(y i ) represents the restored image generated by the second generator, m is the number of images, and i is the image sequence number.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The present invention combines the powerful advantages of generative adversarial networks in image reconstruction and restoration with the advantages of convolutional neural networks in image feature extraction, so that the present invention can achieve better results in image restoration. In order to make the convolutional neural network better adaptable to the generative adversarial network, the network model is modified to make the model more stable and easier to learn. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings in the following descriptions are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work. By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes and advantages of the present invention will become more obvious:
[0032] Figure 1 This is a model framework diagram of an image restoration system based on a cyclic deep convolutional generative adversarial network structure in an embodiment of the present invention;
[0033] Figure 2 This is a workflow diagram of an image restoration system that generates an adversarial network structure using a cyclic deep convolution in an embodiment of the present invention;
[0034] Figure 3 A network structure diagram of a generator in an embodiment of the present invention;
[0035] Figure 4 Schematic diagram of the network structure of the discriminator in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0037] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0038] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0039] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0040] Figure 1 : is a model framework diagram of an image restoration system based on a cyclic deep convolutional generative adversarial network structure in an embodiment of the present invention, such as Figure 1 As shown, the present invention provides an image restoration system based on a cyclic deep convolutional generative adversarial network structure, comprising the following modules:
[0041] A first generator, used to repair the input image sample to generate a repaired image;
[0042] A first discriminator is used to compare the repaired image with a preset target image to determine a first similarity between the repaired image and the preset target image, and then determine whether the similarity reaches a preset first similarity threshold;
[0043] A second generator, connected to the output end of the first generator, for restoring the repaired image to generate a restored image;
[0044] The second discriminator is used to compare the restored image with the image sample to determine a second similarity between the restored image and the image sample, and then determine whether the second similarity reaches a preset second similarity threshold.
[0045] In an embodiment of the present invention, the first generator is a Covnet1 network, the second generator is a Covnet2 network, the first discriminator is a Net1 network, and the second discriminator is a Net2 network.
[0046] The first similarity threshold and the second similarity threshold are set between 85% and 99%.
[0047] Figure 2 FIG. 1 is a flowchart of an image restoration system using a cyclic deep convolutional generative adversarial network structure in an embodiment of the present invention; Figure 2 As shown, when the first discriminator determines that the first similarity reaches a preset first similarity threshold, the restoration of the image sample is completed;
[0048] When the first discriminator determines that the first similarity does not reach the preset first similarity threshold, the image sample is input into the first generator again.
[0049] When the second discriminator determines that the second similarity reaches a preset second similarity threshold, the network parameters of the second generator are saved;
[0050] When the second discriminator determines that the second similarity does not reach the preset second similarity threshold, the image sample is input into the first generator again.
[0051] The first generator, the first discriminator, the second generator and the second discriminator form a cyclic generation network structure;
[0052] The cyclically generated network structure is used to continuously optimize and update network parameters under a loss function, so that the restored image can have more image feature information of the image samples.
[0053] Figure 3 is a network structure diagram of a generator in an embodiment of the present invention, such as Figure 3 As shown, the first generator and the second generator use the resnet50 network as the backbone network to extract features from the input image. The first generator and the second generator use a convolutional network in conjunction with a deconvolutional network;
[0054] The generator is designed according to an encoder-decoder structure.
[0055] The convolution network is used to extract features from image samples; the deconvolution network is used to reconstruct and repair images based on feature vectors extracted by the convolution network.
[0056] The first generator and the second generator are provided with a jump connection structure, and the jump connection structure is used to perform channel number splicing on the feature map obtained by the generator downsampling and the corresponding upsampling to achieve effective fusion of multi-level features of the image. The first discriminator and the second discriminator adopt a fully convolutional neural network, in which the convolution layer is replaced by a pooling layer and a fully connected layer.
[0057] Figure 4 is a network structure diagram of the discriminator in an embodiment of the present invention, such as Figure 4 As shown, in order to make GAN well adapted to convolutional neural networks,
[0058] The network structures of the generator and the discriminator are designed by the following method:
[0059] S1: The pooling layer in the convolutional neural network structure is replaced by a convolutional layer. For the discriminator, the stride convolution is used to replace the pooling layer, and for the generator, the fractional stride convolution is used to replace the pooling. The stride convolution is used for spatial downsampling in the discriminator.
[0060] S2: Remove the fully connected layer; in conventional CNN, a fully connected layer is added after the convolutional layer to output the final vector, but since the fully connected layer has too many parameters, it is easy to cause the network to overfit;
[0061] S3: Set batch normalization; Since deep learning neural networks have many layers, each layer will change the distribution of output data. As the number of layers increases, the overall deviation of the network will become larger and larger. The goal of batch normalization is to solve this problem. By normalizing the input of each layer, the data can be effectively made to obey a fixed data distribution.
[0062] S4: Setting the activation function. The generator and the discriminator use different activation functions. The generator is provided with a RELU function. The output layer of the generator is provided with a tanh function. It is found that using a bounded activation function allows the model to learn faster and cover the color space quickly. All layers in the discriminator use the LEAKRELU function.
[0063] In this embodiment of the present invention, the loss functions of the generator and the discriminator are:
[0064]
[0065] Among them, z represents the image to be processed, x represents the target image, G1(z i ) represents the repaired image generated by the first generator, G2(y i ) represents the restored image generated by the second generator, m is the number of images, and i is the image sequence number.
[0066] Preferably, the algorithm adopts a cyclic generation network structure from image samples to repaired images and then to restored images, and continuously optimizes and updates network parameters under the setting of a reasonable loss function, so that the repaired image can have more image feature information of the image samples.
[0067] in addition, Figure 3 , 4 The inputs of the generator and discriminator are both RGB3 channel images with a size of 256×256. The output of the discriminator is the probability value of judging the authenticity of the generated image. The output of the generator covnet1 is the image after the input image is repaired, and the output of the generator covnet2 is the restored image. The parameters after conv represent the number of channels, step size, and convolution kernel size respectively. Figure 3 The dotted line in the figure indicates that the upsampling result is concatenated with the downsampling result in the corresponding residual network by the number of channels, thus achieving effective fusion of multi-level features of the image.
[0068] In the embodiment of the present invention, the powerful advantages of the generative adversarial network in image reconstruction and restoration and the advantages of the convolutional neural network in image feature extraction are combined, so that the algorithm proposed in the present invention can achieve better results in image restoration. In addition, in order to make the convolutional neural network better adaptable to the generative adversarial network, the network model is modified to make the model more stable and easier to learn.
[0069] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. The above description of the disclosed embodiments enables professionals and technicians in this field to implement or use the present invention. Various modifications to these embodiments will be obvious to professionals and technicians in this field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown in this article, but will comply with the widest range consistent with the principles and novel features disclosed herein.
[0070] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. An image restoration system based on a cyclic deep convolutional generative adversarial network structure, characterized in that: Includes the following modules: A first generator, used to repair the input image sample to generate a repaired image; A first discriminator is used to compare the repaired image with a preset target image to determine a first similarity between the repaired image and the preset target image, and then determine whether the first similarity reaches a preset first similarity threshold; A second generator, connected to the output end of the first generator, for restoring the repaired image to generate a restored image; A second discriminator is used to compare the restored image with the image sample to determine a second similarity between the restored image and the image sample, and then determine whether the second similarity reaches a preset second similarity threshold; When the first discriminator determines that the first similarity reaches a preset first similarity threshold, the restoration of the image sample is completed; When the first discriminator determines that the first similarity does not reach the preset first similarity threshold, inputting the image sample into the first generator again; When the second discriminator determines that the second similarity reaches a preset second similarity threshold, the network parameters of the second generator are saved; When the second discriminator determines that the second similarity does not reach the preset second similarity threshold, inputting the image sample into the first generator again; The first generator, the first discriminator, the second generator and the second discriminator form a cyclic generation network structure; The cyclically generated network structure is used to continuously optimize and update network parameters, so that the restored image can have more image feature information of the image samples.
2. The image restoration system based on the cyclic deep convolutional generative adversarial network structure according to claim 1 is characterized in that: The first generator and the second generator use the resnet50 network as the backbone network to extract features from the input image.
3. The image restoration system based on the cyclic deep convolutional generative adversarial network structure according to claim 1 is characterized in that: The first discriminator and the second discriminator adopt a fully convolutional neural network.
4. The image restoration system based on the cyclic deep convolutional generative adversarial network structure according to claim 1 is characterized in that: The first generator and the second generator adopt a method of using a convolutional network in conjunction with a deconvolutional network; The convolution network is used to extract features from image samples; the deconvolution network is used to reconstruct and repair images based on feature vectors extracted by the convolution network.
5. The image restoration system based on the cyclic deep convolutional generative adversarial network structure according to claim 1 is characterized in that: The first generator and the second generator are provided with a jump connection structure, and the jump connection structure is used to perform channel splicing on the feature maps obtained by the generator downsampling and the corresponding upsampling, so as to realize the effective fusion of multi-level features of the image.
6. The image restoration system based on the cyclic deep convolutional generative adversarial network structure according to claim 1 is characterized in that: The network structures of the generator and the discriminator are designed by the following method: S1: The pooling layer in the convolutional neural network structure is replaced by a convolutional layer. For the discriminator, the stride convolution is used to replace the pooling layer, and for the generator, the fractional stride convolution is used to replace the pooling. The stride convolution is used for spatial downsampling in the discriminator. S2: remove the fully connected layer; S3: Set up batch normalization; S4: Setting an activation function. The generator and the discriminator use different activation functions. A RELU function is set in the generator. The output layer of the generator is set with a tanh function. All layers in the discriminator use a LEAKRELU function.
7. The image restoration system based on the cyclic deep convolutional generative adversarial network structure according to claim 6 is characterized in that: The loss functions of the generator and the discriminator are: , Among them, z represents the image to be processed, x represents the target image, represents the repaired image generated by the first generator, Represents the restored image generated by the second generator, m is the number of images, and i is the image sequence number.
