A method for improving underwater image resolution based on improved generative adversarial network
By improving the generative adversarial network model and enhancing the structure and feature connections of the generator module, the problem of missing and blurred underwater image details is solved, and higher-quality underwater image reconstruction is achieved.
Patent Information
- Application Number
- CN202111328591.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Underwater images lack details and are blurred due to the complex environment. It is difficult for existing image super-resolution reconstruction methods based on generative adversarial networks to effectively restore detailed information.
Improve the generative adversarial network model by introducing three layers of identity residual blocks and dense skip connections in the generator module, removing the BN layer, and changing the activation function to Relu to enhance the connection between low-level features and high-level features, reduce the amount of calculation, and improve the image authenticity and texture clarity.
The detailed information and quality of underwater images are significantly improved, and the generated images are more realistic and have clearer textures, which are suitable for super-resolution reconstruction of images taken by underwater robots.
Smart Images

Figure CN114037843B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and deep learning, and in particular to a method for improving underwater image resolution based on an improved generative adversarial network. Background Art
[0002] In recent years, with the growth of global population, the consumption of resources on land has been accelerating. The ocean occupies most of the earth's area and has rich biological and oil resources. Therefore, the development of marine resources is an important direction for future development.
[0003] When exploring and developing marine resources, the current mainstream method is to obtain underwater information through underwater robots. However, the underwater environment is relatively complex. For example, the turbulence of the underwater environment, the scattering of light caused by suspended matter in the seawater, and the loss of color channels caused by light attenuation, etc., make underwater images show color deviation, lack of details, and low contrast, which also makes underwater images difficult to use for detection, segmentation and other applications. Therefore, it is of great significance to improve the quality of underwater images and solve the problems of missing details and blurring of underwater images.
[0004] Image super-resolution reconstruction technology refers to restoring low-resolution images to high-resolution images through certain algorithms. Image super-resolution reconstruction technology can be used to improve image details, deblur images, and thus improve image quality, which is helpful for solving the problems of missing details and blurring in underwater images. At the same time, image super-resolution reconstruction technology can reduce some limitations on the internal resolution of each image system under specific conditions, thereby improving the resolution processed by each image system. Image super-resolution reconstruction technology has important applications in many fields, such as security monitoring, medical imaging, and drone remote sensing technology.
[0005] Image super-resolution reconstruction based on generative adversarial networks is a relatively common method in current image reconstruction. By building a model, learning the mapping method between low-level features and high-level features, and using previously learned prior knowledge, the high-frequency details of the image are restored to achieve the purpose of reconstruction. This can achieve better results than traditional methods.
[0006] The network structure of the generative adversarial network consists of a generator and a discriminator. The generator and the discriminator are trained alternately and iteratively to achieve the effect that the samples generated by the generator are sufficiently realistic. The advantage of using a generative adversarial network for image super-resolution reconstruction is that it does not rely on a preset distribution. Its disadvantage is that when used for underwater image super-resolution reconstruction, due to the complex underwater environment, the features cannot be well learned, resulting in the lack of detailed information in the generated images, so it needs to be improved. Summary of the invention
[0007] The purpose of the present invention is to provide a method for improving the resolution of underwater images based on an improved generative adversarial network, apply the improved generative adversarial network model to underwater image processing, better train the generator module, thereby improving the quality of underwater images and increasing the detail information of underwater images.
[0008] To achieve the above object, the present invention provides a method for improving underwater image resolution based on an improved generative adversarial network, comprising the following steps:
[0009] Build and improve generative adversarial network models;
[0010] Obtain existing underwater images and create the data set required for training, while performing data enhancement and data set division;
[0011] Training the improved generative adversarial network model to obtain a trained network model;
[0012] Acquire real-time underwater images and process them into small images;
[0013] Inputting the small block image into the trained network model to obtain a network output result;
[0014] The network output results are concatenated to obtain the final result.
[0015] Among them, the basic module of the improved generative adversarial network model consists of a generator module and a discriminator module. The residual convolution in the generator module is changed to a three-layer identical residual block. The output result of each of the three-layer identical residual blocks is used as the input feature of each subsequent layer, and the activation function is changed from Sigmoid to Relu.
[0016] Among them, the generator module uses one convolution layer and one Relu activation layer as the input layer, eight three-layer identical residual blocks as the hidden layer, removes the BN layer in the original network structure, and the output layer uses two sub-pixel convolution layers and a convolution layer with a 3×3 kernel and output channel.
[0017] The determiner module includes eight basic blocks, a fully connected layer and a Sigmoid activation layer, wherein each basic block is composed of a convolutional layer, a BN layer and a Leaky Reulu activation function.
[0018] Among them, in the process of acquiring existing underwater images and making the data set required for training, the acquired underwater images are cut into images with a resolution of 256×256, and each cut image is downgraded by the Bicubic algorithm, and four times downsampled to a low-resolution image with a resolution of 64×64. The downgraded images are used as low-resolution image data sets, and the corresponding high-resolution images are used as high-resolution image data sets. Then, the low-resolution image data sets and the high-resolution image data sets are simultaneously rotated, offset, and noise-added data enhancement processing is performed. Finally, all the processed data are divided into training set, validation set, and test set according to the ratio of 7:2:1.
[0019] Wherein, training the improved generative adversarial network model to obtain an optimized generative adversarial network model comprises the following steps:
[0020] Input the data set required for the training into the generative network and the discriminative network respectively, and set a maximum number of training times;
[0021] Select the target optimization function and calculate the discriminant network loss;
[0022] Using an optimizer to update the network parameters of the discriminant network;
[0023] Obtaining a discrimination result through the discrimination network;
[0024] Select the target optimization function and calculate the generated network loss;
[0025] Using an optimizer to update network parameters of the generated network;
[0026] Repeat the above steps until the network is fitted or the maximum number of training times is reached;
[0027] Save the trained network model.
[0028] The acquired real-time underwater images are processed into small-block images by cutting.
[0029] The small block images are images of equal size with a resolution of 64×64.
[0030] The invention discloses a method for improving underwater image resolution based on an improved generative adversarial network. The improved generative adversarial network is used for underwater image super-resolution reconstruction. The invention first improves the generative adversarial network. On the premise that the generative adversarial network can perform adversarial training, the residual block is changed to a three-layer identical residual block by improving the structure of the generator module, and a dense skip connection structure is introduced to increase the connection between low-level features and high-level features, so that the generated image is more realistic and the texture is clearer. At the same time, considering that the BN layer is not suitable for image super-resolution reconstruction, the BN layer in the generator module is subtracted, and the activation function of the generator module is changed from Sigmoid to Relu to prevent the gradient explosion problem, thereby reducing the calculation amount of the entire network and improving the real-time performance of the network. The invention can perform super-resolution reconstruction on underwater images taken by underwater robots to achieve the purpose of improving the quality of underwater images. 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 It is a flow chart of a method for improving underwater image resolution based on an improved generative adversarial network of the present invention.
[0033] Figure 2 It is a schematic diagram of the three-layer identical residual block structure of the present invention.
[0034] Figure 3 It is a schematic diagram of the network model of the generator module of the present invention.
[0035] Figure 4 Schematic diagram of the network model of the determiner module of the present invention.
[0036] Figure 5 It is a schematic diagram of the process of making a data set according to the present invention. DETAILED DESCRIPTION
[0037] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0038] See also Figure 1The present invention proposes a method for improving underwater image resolution based on an improved generative adversarial network, comprising the following steps:
[0039] S1: Build an improved generative adversarial network model;
[0040] S2: Obtain existing underwater images and create the data set required for training, while performing data enhancement and data set division;
[0041] S3: training the improved generative adversarial network model to obtain a trained adversarial network model;
[0042] S4: Acquire real-time underwater images and process them into small images;
[0043] S5: inputting the small block image into the trained network model to obtain a network output result;
[0044] S6: Connect the network output results to obtain the final result.
[0045] In this embodiment, underwater images of a certain sea area can be acquired by taking real-time images by an underwater robot, and then the acquired current images are cut into images of equal size with a resolution of 64×64, which are input into the trained network model to obtain high-resolution images. Finally, the output high-resolution images are spliced according to the cropping position of the original images to obtain the final result.
[0046] Furthermore, the basic module of the generative adversarial network is constructed. The basic module is still composed of the generator module and the discriminator module, but the residual convolution in the generator module is changed to a three-layer identical residual block, such as Figure 2 It is a three-layer identical residual block structure. At the same time, the output result of each identical residual block is used as the input feature of each subsequent layer to increase the connection between the low-level features and high-level features of the network. The activation function is changed from Sigmoid to Relu to prevent the gradient explosion problem.
[0047] See also Figure 3 , the generator module model is: one convolution layer and one activation layer as the input layer, where the convolution layer is a convolution layer with 3 input channels, 64 output channels and a 9×9 kernel, and the step size is set to 1; the hidden layer is composed of 8 three-layer identical residual blocks, where each three-layer identical residual block is composed of three layers of convolution layers with 64 input and output channels and a 3×3 kernel and two layers of Relu activation layers, where the step size of the convolution layer is set to 1, and the two activation layers are respectively between the three convolution layers, and the output result of the first convolution layer will be directly added to the output result of the third convolution layer: x l+2 =x l +F2(F1(x l ,ω l)), the sum is used as the output result of the identical residual block, and the output result of each identical residual block is used as the input feature of the subsequent identical residual block, that is, the i-th th The three-layer identity residual block receives the feature maps of all the previous three-layer identity residual blocks as input: X i =max(0,ω i *[X1,X2,...,X i-1 ]+b i ), where [X1,X2,...,X i-1 ] represents the concatenation of the feature maps generated in the previous three layers of identical residual blocks 1, 2, ..., i-1, and removes the BN layer in the original network structure; the output layer uses two sub-pixel convolution layers with 256 input channels and 64 output channels to enlarge the image feature size. Each sub-pixel convolution layer is followed by a Relu activation function layer, and a convolution layer with a 9×9 kernel, 64 input channels and 3 output channels is used to output the generated image, and its step size is set to 1. The output result is a super-resolution image G i .
[0048] like Figure 4 is the network model of the discriminator module. The discriminator module model is: 8 basic blocks perform feature extraction on the input image, wherein each basic block consists of a convolution layer with a kernel, a BN layer, and a LeakyReulu activation layer. At the same time, the convolution layer of the first basic block has 3 input channels and 64 output channels, the convolution layer of the second basic block has 64 input channels and 128 output channels, the convolution layer of the third basic block has 128 input channels and 128 output channels, the convolution layer of the fourth basic block has 128 input channels and 256 output channels, the convolution layer of the fifth basic block has 256 input channels and 256 output channels, and the convolution layer of the sixth basic block has The convolution layer has 256 input channels and 512 output channels. The convolution layer of the seventh basic block has 512 input channels and 1024 output channels. The convolution layer of the eighth basic block has 1024 input channels and 1024 output channels. The step sizes of every two convolution layers with the same number of channels are 1 and 2, respectively, alternating between them. That is, the step sizes of the convolution layers of the first, third, fifth, and seventh basic blocks are set to 1, and the step sizes of the convolution layers of the second, fourth, sixth, and eighth basic blocks are set to 2. As the network depth increases, the image feature size decreases, while the number of features increases. After that, the features are integrated through a fully connected layer with 1024 channels, and the image features are mapped into one-dimensional data through a Sigmoid activation layer. The output of the final discriminator module is the probability of discriminating the image as real data.
[0049] To further explain, the original BN layer is removed from the generator network module because the BN layer actually stretches the color of the image to a certain extent, and when performing image super-resolution reconstruction, it is necessary to pay attention to the information of the image itself, and the BN layer introduces the statistics of other images in the same batch, which will weaken the characteristics of the image itself, which will affect the generation of super-resolution images. Therefore, the BN layer is not suitable for image super-resolution reconstruction and is removed from the generator network module; the BN layer is retained in the judge module because the judge module does not need to generate super-resolution images, but only compares the super-resolution images generated by the generator module with the real high-resolution images, and then outputs the judgment results. Retaining the BN layer can also accelerate the convergence of the network, so the BN layer is retained in the judge network module.
[0050] For further information, see Figure 5 In the process of acquiring existing underwater images and making the data sets required for training, the underwater images are cut into images with a resolution of 256×256, and each cut image is downgraded by the Bicubic algorithm, and four times downsampled to a low-resolution image with a resolution of 64×64. The downgraded images are used as low-resolution image data sets, and the corresponding high-resolution images are used as high-resolution image data sets. Then, the low-resolution image data sets and the high-resolution image data sets are simultaneously rotated, offset, and noise-added data enhancement processing is performed. Finally, all the processed data are divided into training set, validation set, and test set according to 7:2:1.
[0051] Training the improved generative adversarial network model to obtain an optimized generative adversarial network model includes the following steps:
[0052] S20: Input the processed data set into the constructed network model for adversarial training, where the low-resolution data set {z1,z2,...,z n} is input into the generative network G to obtain the generated images {G(z1),G(z2),...,G(z n )}, generating images {G(z1),G(z2),...,G(z n )} and high-resolution datasets {x1,x2,...x n} will be input into the discriminant network D at the same time, and the maximum number of training times is set to 10,000;
[0053] S21: The objective optimization function of the entire network is:
[0054]
[0055] in, represents the minimization objective function, represents the maximization objective function, p data (x) is the expected probability of the real data x, p z (z) is the expected probability of generating data G(x), D represents the discriminant network, D(x) represents the discriminant probability of the real sample, G represents the generating network, G(z) represents the generated sample, and D(G(z)) represents the discriminant probability of the generated sample. The optimization goal of the discriminant network D is:
[0056]
[0057] Calculate the discriminator network loss by optimizing the objective function of network D;
[0058] S22: Use the optimizer to update the network parameters θ of the discriminant network D :
[0059]
[0060] S23: low-resolution dataset {z1,z2,...,z n} is input into the generative network G to generate {G(z1),G(z2),...,G(z n )}; Generate images {G(z1),G(z2),...,G(z n )} and high-resolution datasets {x1,x2,...x n} will be simultaneously input into the discriminant network D to obtain the discriminant result;
[0061] S24: From the third step, the optimization goal of the generated network G can be obtained as:
[0062]
[0063] According to the discriminant results, the loss of the generated network G is calculated using the optimization objective function;
[0064] S25: Use the optimizer to update the network parameters θ of the generated network G :
[0065]
[0066] S26: Continue training and repeat steps 2 to 7 until the network is fitted or the maximum number of training times is reached;
[0067] S27: Save the trained network model.
[0068] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A method for improving underwater image resolution based on an improved generative adversarial network, characterized in that: The following steps are involved: Build and improve generative adversarial network models; The basic module of the improved generative adversarial network model consists of a generator module and a discriminator module. The residual convolution in the generator module is changed to a three-layer identical residual block. The output result of each of the three-layer identical residual blocks is used as the input feature of each subsequent layer. The activation function is changed from Sigmoid to Relu. The determiner module includes eight basic blocks, a fully connected layer and a Sigmoid activation layer, wherein each of the basic blocks consists of a convolutional layer, a BN layer and a Leaky Reulu activation layer; The convolution layer of the first basic block has 3 input channels and 64 output channels, the convolution layer of the second basic block has 64 input channels and 128 output channels, the convolution layer of the third basic block has 128 input channels and 128 output channels, the convolution layer of the fourth basic block has 128 input channels and 256 output channels, the convolution layer of the fifth basic block has 256 input channels and 256 output channels, the convolution layer of the sixth basic block has 256 input channels and 512 output channels, the convolution layer of the seventh basic block has 512 input channels and 1024 output channels, the convolution layer of the eighth basic block has 1024 input channels and 1024 output channels, and the strides of every two convolution layers with the same number of channels are 1 and 2 alternately; Obtain existing underwater images and create the data set required for training, while performing data enhancement and data set division; Training the improved generative adversarial network model to obtain a trained network model; Acquire real-time underwater images and process them into small images; Inputting the small block image into the trained network model to obtain a network output result; The network output results are concatenated to obtain the final result.
2. The method for improving underwater image resolution based on an improved generative adversarial network according to claim 1, characterized in that: The generator module uses one convolution layer and one Relu activation layer as the input layer, eight three-layer identical residual blocks as the hidden layer, removes the BN layer in the original network structure, and the output layer uses two sub-pixel convolution layers and one convolution layer with a 3×3 kernel and output channels.
3. The method for improving underwater image resolution based on an improved generative adversarial network according to claim 1, characterized in that: In the process of acquiring existing underwater images and making the data sets required for training, the acquired underwater images are cut into images with a resolution of 256×256, and each cut image is downgraded by the Bicubic algorithm, and four times downsampled to a low-resolution image with a resolution of 64×64. The downgraded images are used as low-resolution image data sets, and the corresponding high-resolution images are used as high-resolution image data sets. Then, the low-resolution image data sets and the high-resolution image data sets are simultaneously rotated, offset, and noise-added data enhancement processing is performed. Finally, all the processed data are divided into training set, validation set, and test set according to the ratio of 7:2:
1.
4. The method for improving underwater image resolution based on an improved generative adversarial network according to claim 1, characterized in that: Training the improved generative adversarial network model to obtain an optimized generative adversarial network model includes the following steps: Input the data set required for the training into the generative network and the discriminative network respectively, and set a maximum number of training times; Select the target optimization function and calculate the discriminant network loss; Using an optimizer to update the network parameters of the discriminant network; Obtaining a discrimination result through the discrimination network; Select the target optimization function and calculate the generated network loss; Using an optimizer to update network parameters of the generated network; Repeat the above steps until the network is fitted or the maximum number of training times is reached; Save the trained network model.
5. The method for improving underwater image resolution based on an improved generative adversarial network according to claim 1, characterized in that: The acquired real-time underwater images are processed into small images by cutting.
6. The method for improving underwater image resolution based on an improved generative adversarial network according to claim 1, characterized in that: The small block images are images of equal size with a resolution of 64×64.
