Image motion blur removal method based on improved cyclic generative adversarial network
Through the improved loop generative adversarial network and loop generative adversarial network, combined with Wasserstein distance and loop consistency loss, the problems of inaccurate blur kernel estimation and over-enhancement of high-frequency spectral components in image de-motion blur are solved, and efficient image processing is achieved Remove motion blur and improve recognition accuracy.
Patent Information
- Application Number
- CN202011593957.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-12-29
AI Technical Summary
In the process of image de-motion blur, the existing technology has problems such as inaccurate blur kernel estimation, lack of feature consistency loss constraints, and over-enhancement of high-frequency spectral components, resulting in reduced recognition accuracy, and the traditional method has a large amount of calculation and a large number of iterations. , high hardware requirements and susceptible to environmental noise.
Using an improved cyclic generative adversarial network, by constructing a generator network, a PatchGAN discriminator network and a cyclic generative adversarial network, combined with the adversarial loss of Wasserstein distance and the feature loss of cycle consistency, a joint loss function is constructed, using the Switchable normalization layer and two-dimensional Fourier transform to remove excess high-frequency information to form a deblurring generator and a blur generator to achieve motion blurring of the image.
It improves the robustness and recognition accuracy of image de-motion blur, reduces hardware requirements, solves the problem of losing original image features in unsupervised training, and enhances the robustness of the system and the reliability of the recognition results.
Smart Images

Figure CN112634163B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer image processing and relates to a method for removing image motion blur based on an improved cyclic generative adversarial network. Background Art
[0002] Image motion blur removal has always been one of the important research directions in the field of computer vision and image processing. When shooting handheld, the motion blur caused by the relative movement between the camera lens and the scene during the exposure process becomes one of the important reasons that affect the recognition results.
[0003] Motion blur is also called dynamic blur. Depending on whether the blur kernel is known, the image deblurring problem is mainly divided into blind deblurring algorithm and non-blind deblurring algorithm. The principle of non-blind image deblurring is to use the known blur kernel to perform deconvolution operation to complete the image restoration. In 2011, Zhao et al. [1] proposed a new image deblurring algorithm based on RL, which is an image restoration algorithm in the time domain. It can effectively suppress the problem of ringing response kernel image noise method and retain certain image details. In 2016, Luo et al. [2] proposed an image deblurring method combining total variation and fractional order total variation model, established a convex optimization model of the deblurred image, and quickly solved the model using variable separation and alternating direction method. The results show that the algorithm can obtain a higher peak signal-to-noise ratio and structural self-similarity index. On the other hand, blind image deblurring needs to estimate the blur kernel first, convert it into non-blind image deblurring, and then perform deconvolution image restoration. For the estimation of unknown blur kernels, the regularization method of standardized sparse priors is often used to estimate the complex blur kernel [3], and the diffusion function of the image is derived using the geometric relationship model of the binocular camera [4]. In actual situations, due to the large randomness of motion during handheld shooting, coupled with the complex and unpredictable relative motion with the photographed object, it conforms to the relevant theories and methods of blind image deblurring. In this regard, the key point of traditional methods is to restore motion blur through rich image physical parameters and complex mathematical calculations, but they all have shortcomings such as a large number of iterations, large amount of calculation, high requirements on camera hardware, and are easily affected by environmental noise.
[0004] With the widespread use of deep learning in the field of computer vision, image deblurring has achieved certain results with the help of convolutional neural networks. In 2014, Xu et al. [5] proposed a non-blind deblurring method using convolutional neural networks to estimate blur kernels, opening a new chapter in the field of image deblurring using deep learning. In 2017, Nah et al. [6] used convolutional neural networks to directly restore clear images from degraded images for blind deblurring. The above methods still have problems such as inaccurate blur kernel estimation and lack of feature consistency loss constraints. They do not pay attention to the fact that the deblurred image will have redundant high-frequency spectral components in the frequency domain, resulting in new errors between the deblurred image and the original image, reducing the image recognition accuracy.
[0005] References:
[0006] [1] Zhao Bo, Zhang Wensheng, and Ding Huan, “A new image deblurring algorithm based on Richardson-Lucy,” Computer Engineering and Applications, vol. 47, no. 34, pp. 1-4+77, 2011.
[0007] [2] Luo Guangli and Yang Xiaomei, "Image deblurring based on total variation and fractional order total variation model," Computer Engineering and Design, vol. 37, no. 07, pp. 1857-1861+1866, 2016.
[0008] [3] Tang Meng, Peng Guohua, and Zheng Hongchan, “Blind image deblurring based on regularization method,” Journal of Computer Applications, vol. 31, no. 02, pp. 596-599+611, 2014.
[0009] [4] Hong Hanyu, Zhang Wenmo, Zhang Xiuhua, and Shi Yu, “Deblurring method for binocular motion images,” Journal of Wuhan Institute of Technology, vol. 37, no. 04, pp. 45-50, 2015.
[0010] [5] L.Xu, JSRen, C.Liu, and J.Jia, "Deep convolutional neural network for image deconvolution," Advances in neural information processing systems, vol.27, pp.1790-1798, 2014.
[0011] [6] S.Nah, T.Hyun Kim, and K.Mu Lee, "Deep multi-scale convolutional neural network for dynamic scene deblurring," in Proceedings of the IEEEConference on Computer Vision and Pattern Recognition, 2017, pp.3883-3891. Summary of the invention
[0012] Purpose of the invention: The technical problem to be solved by the present invention is to provide a method for removing image motion blur based on an improved cyclic generative adversarial network in view of the shortcomings of the prior art.
[0013] In order to solve the above technical problems, the present invention discloses a method for removing image motion blur based on an improved cyclic generative adversarial network, comprising the following steps:
[0014] Step 1, select a blurry-clear image dataset and construct an unpaired blurry-clear dataset as a training dataset and a test dataset;
[0015] Step 2: construct a generator network, which includes an encoder module, a feature converter module, and a decoder module;
[0016] Step 3, construct a PatchGAN discriminator network that divides the image into receptive field blocks;
[0017] Step 4, construct a joint loss function by using the adversarial loss based on Wasserstein distance and the feature loss of cycle consistency;
[0018] Step 5: According to the generator network and discriminator network obtained in step 2 and step 3, two mirror-imaged annular generative adversarial networks (GAN) are constructed to cooperate with each other to obtain a cyclic generative adversarial network model, including a deblurring generator, a blurring generator, a clear discriminator and a blurring discriminator; correspondingly, there are two adversarial loss functions to balance the conversion between the overall blur and clear images.
[0019] Step 6, inputting the motion blurred image to be processed into the deblurring generator trained in step 5 to obtain a preliminary deblurred image;
[0020] Step 7, performing a two-dimensional Fourier transform on the preliminary deblurred image obtained in step 6, filtering out the redundant high-frequency bright spot spectrum components generated by over-enhancement, and obtaining an accurate and clear image.
[0021] In one implementation, step 1 includes:
[0022] Step 1: The selected blurry-clear image dataset is randomly rotated along the x-axis, y-axis, and z-axis to simulate the real scene of handheld shooting. The angle of the random rotation satisfies the following constraints:
[0023]
[0024] Among them, α, β, γ represent the angular differences between the camera coordinate system and the world coordinate system on the x-axis, y-axis, and z-axis, respectively, and λ1, λ2, and λ3 are random deformation factors.
[0025] In one implementation, in step 2,
[0026] The encoder module consists of three convolutional neural network layers, each convolution layer uses a switchable normalization layer and a ReLU activation function; the convolution kernel size of the first downsampling layer is 7×7, the convolution step is 1, and the number of convolution kernels is 64; the convolution kernel size of the second downsampling layer is 3×3, the convolution step is 2, and the number of convolution kernels is 128; the convolution kernel size of the third downsampling layer is 3×3, the convolution step is 2, and the number of convolution kernels is 256;
[0027] The feature converter module consists of nine layers of residual network blocks. Each convolution layer uses a switchable normalization layer and a ReLU activation function. The convolution kernel size is 3×3, the convolution step is 1, and the number of convolution kernels is 256. By mapping the redundant layers in the deep network identically, the error of the overall network is ensured to no longer increase, so as to prevent the loss of features of the input image.
[0028] The decoder module consists of three convolutional neural network layers, each convolution layer uses a switchable normalization layer and a ReLU activation function; the first and second layers are transposed convolution layers, the convolution kernel size is 1×1, the convolution step is 2, and the number of convolution kernels is 128; the third layer is a convolution layer, the convolution kernel size is 7×7, the convolution offset is 1, and the number of convolution kernels is 64.
[0029] In one implementation, the discriminator network in step 3 uses the receptive field block to divide the input image into M×M blocks and map them into an M×M matrix X, X ij represents the probability that the receptive field block in the i-th row and j-th column is a true sample. ijThe output after averaging is used as the final output of the discriminator; where M affects the fineness of the image division, indicating that the input image is divided into M columns in the width direction and M rows in the height direction using the receptive field block, 0≤i<M, 0≤j<M. The discriminator structure of PatchGAN is used to extract and represent local image features, which is more conducive to the generation of high-resolution images. Compared with the classic GAN network, a more reasonable loss representation is achieved for local images with large feature differences.
[0030] In one implementation, step 4 establishes an adversarial loss function based on Wasserstein distance, which is expressed as follows:
[0031] Among them G X , D X is the deblurring generator and clear discriminator obtained after training, G Y , D Y are the fuzzy generator and fuzzy discriminator, x, y, z are the data distribution of clear image, fuzzy image and penalty domain respectively, λ is the penalty factor, and the gradient is made as close to 1 as possible through back propagation optimization, E represents the mean operation, Indicates D X (z) Find the 2-norm distance after the gradient in the z direction.
[0032] In one implementation, step 4 establishes a cycle-consistent feature loss function, which is expressed as follows:
[0033]
[0034] Among them G X and G Y It is a generator network that generates sharp and blurred images.
[0035] In one implementation, step 4 constructs a joint loss function, which is expressed as follows:
[0036]
[0037] in It is the weight used to balance the adversarial loss based on Wasserstein distance and the cycle consistency loss.
[0038] In one implementation, step 5 includes the following steps:
[0039] Step 5-1: Input a real clear picture into the improved cyclic generative adversarial network to train the discriminator;
[0040] Step 5-2: Input the real blurred image through the deblurring generator GX , converted into a pseudo-clear image and sent to the clear discriminator D X , and fed back to the deblurring generator G X , improve the authenticity of the images generated by the generator;
[0041] Step 5-3: The generated pseudo-clear image passes through the blur generator G Y , converting it into a pseudo-blurred image. At this time, the cycle consistency loss between the generated pseudo-blurred image and the real blurred image is calculated to ensure that the deblurring process does not lose the features of the original image;
[0042] Step 5-4: Repeat until the network converges and retain the first defuzzified generator G X spare.
[0043] In one implementation, step 7 of the present invention includes the following sub-steps:
[0044] Step 7-1: Perform a two-dimensional Fourier transform on the original clear image to obtain an image frequency domain result of the original clear image;
[0045] Step 7-2: Perform a two-dimensional Fourier transform on the preliminary deblurred image after the deblurring generator to obtain an image frequency domain result of the preliminary deblurred image;
[0046] Step 7-3: extracting high-frequency bright spot information newly appearing in the image frequency domain result of the initial deblurred image at the high-frequency information in the image frequency domain result compared with the image frequency domain result of the original clear image;
[0047] Step 7-4: Perform a filtering transformation on the highlight information of the preliminary deblurred image.
[0048] In one implementation, the blurry-clear image dataset in step 1 uses the publicly available GOPRO_Large dataset, which includes street view images taken by a high-frame camera and artificially synthesized blurry images.
[0049] Beneficial effects:
[0050] (I) The image motion blur removal method proposed in the present invention targets motion blur, solves the blur problem caused by motion with better effect and higher robustness, and completes the task of mobile terminal target recognition without motion blur. By removing motion blur, images with unclear edge details due to relative motion can convey richer semantic information to the outside world, making the recognition results more accurate and reliable. This makes it possible to use relatively cheap mobile phone cameras instead of high-speed cameras, greatly improving the efficiency of mobile terminal image intelligent recognition.
[0051] (ii) The image motion deblurring method proposed in the present invention solves the problem of losing the original image features in unsupervised training for unpaired data sets. It is difficult to collect completely consistent paired clear-blurred images for motion blur data sets. The traditional GAN network is prone to losing the features of the original image during unpaired unsupervised training. Although the generated image completes the deblurring task, it still has a certain or large difference from the original image, which leads to errors in the subsequent image recognition results. The present invention uses two mirrored GAN networks to form a ring network and introduces the calculation of the cycle consistency loss function to ensure that the generator can output images with a high similarity to the original image for unsupervised training of unpaired data sets.
[0052] (III) The present invention proposes to use the more adaptable SwitchableNorm normalization method (SwitchableNormalization) to complete the work of removing motion blur. The SwitchableNorm normalization method combines the batch normalization algorithm (Batch Normalization, BN), the layer normalization algorithm (Layer Normalizaiton, LN), and the instance normalization algorithm (InstanceNormalization, IN) to determine the appropriate normalization operation for each normalization layer in the network through differentiable learning, and assign weights to each algorithm to obtain the normalization method with the best effect under its own network structure.
[0053] (IV) The present invention proposes to perform a two-dimensional Fourier transform on the image after preliminary deblurring, extract the high-frequency bright spot information that appears newly in the high-frequency information of the image frequency domain result compared to the original frequency domain, and achieve the removal of the pseudo-enhancement phenomenon in the spectrum. The image recognition result after filtering does not have a pseudo-recognition result like the clear image, which enhances the accuracy of the deblurring network and improves the robustness of the system.
[0054] (V) In the embodiment of the present invention, a random rotation distortion factor is added to the model training set, and the performance of the network in the time domain and frequency domain is considered at the same time, and a more comprehensive blurred image preprocessing method is proposed. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more clear.
[0056] Figure 1 It is a flow chart of the implementation of the present invention;
[0057] Figure 2 It is the generated network structure diagram in the present invention;
[0058] Figure 3It is a diagram of the adversarial network structure in the present invention;
[0059] Figure 4 It is a diagram of the training process of the cyclic generation network for deblurring in the present invention;
[0060] Figure 5 It is a comparison chart of YOLO target recognition results before and after deblurring in the present invention;
[0061] Figure 6 It is a two-dimensional Fourier transform comparison diagram of the image in the present invention;
[0062] Figure 7 It is a two-dimensional Fourier transform result diagram after removing the bright spot information in the present invention;
[0063] Figure 8 It is the YOLO target recognition result after removing the bright spot information in the present invention. DETAILED DESCRIPTION
[0064] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0065] Figure 1 : is a flowchart of a method for removing image motion blur based on an improved cyclic generative adversarial network in an example of the present invention, comprising the following steps:
[0066] Step 1: Select an existing publicly available blurry-clear image dataset and construct an unpaired blurry-clear dataset as a training dataset and a test dataset. In this embodiment, the publicly available GOPRO_Large dataset is used, and the GOPRO_Large dataset includes street view images taken by a high-frame camera and artificially synthesized blurry images.
[0067] To further improve the generalization ability and recognition accuracy of the model for motion blur, including handheld objects shot at non-vertical angles, the network model is trained using data enhancement methods, and the input training samples are randomly adjusted in angle, expressed as:
[0068]
[0069] α, β, and γ are the angular differences between the camera coordinate system and the world coordinate system on the x-axis, y-axis, and z-axis, respectively. λ1, λ2, and λ3 are random deformation factors, and random rotation distortion is performed between the three axes to simulate the handheld shooting effect.
[0070] Step 2: Build a generator network consisting of a 3-layer encoder, a 9-layer feature converter, and a 3-layer decoder.
[0071] In this embodiment, refer to Figure 2The generator network consists of a 3-layer encoder, a 9-layer feature converter, and a 3-layer decoder. Each convolution layer uses a switchable normalization layer and a ReLU activation function. The generator first extracts features through three convolution layers. The convolution kernel size of the first downsampling layer is 7×7, the convolution step is 1, and the number of convolution kernels is 64, ensuring that the size of the input data remains unchanged; the convolution kernel size of the second downsampling layer is 3×3, the convolution step is 2, and the number of convolution kernels is 128; the convolution kernel size of the third downsampling layer is 3×3, the convolution step is 2, and the number of convolution kernels is 256, achieving a double downsampling effect and completing the encoding work. Next, the feature converter realizes the feature conversion from the blurred image domain to the clear image domain and the removal of image motion blur through a 9-layer ResNet network. The convolution kernel size is 3×3, the convolution step is 1, and the number of convolution kernels is 256. Finally, the decoder receives the feature map of the feature converter and passes it through two reverse convolution layers, with a convolution kernel size of 1×1, a convolution step of 2, and 128 convolution kernels, to restore the high-dimensional features to low-dimensional features, complete upsampling, and send it to a convolution layer to generate a clear image, with a convolution kernel size of 7×7, a convolution offset of 1, and 64 convolution kernels, to complete the decoding work. In the network structure of the entire generator, the decoder and the encoder are symmetrical to each other, completing the image-to-image style transfer task.
[0072] In addition, each convolutional layer in step 2 uses a switchable normalization layer. The switchable normalization layer combines the BN algorithm, LN algorithm, and IN algorithm, and uses differentiable learning to determine the appropriate normalization operation for each normalization layer in the network. Each algorithm is assigned a weight to obtain the normalization method with the best effect under its own network structure. The calculation formula of SN is expressed as:
[0073]
[0074] The SN algorithm simultaneously calculates the mean and variance of the three normalization methods of BN, LN, and IN, and calculates the weights of the six parameters. Finally, the weighted coefficients are normalized using SOFTMAX. Assume that the size of a feature map to be processed is (N, C, W, H), where h ncij and are the values of the pixels before and after normalization, respectively; n∈[1, N], c∈[1, C], i∈[1, H], j∈[1, W]; γ and β represent the scaling factor and translation factor, respectively; Ω represents the set of BN, LN, IN; μ k and Represent the mean and variance respectively; ε is a very small number to prevent division by 0; ω kand ω′ k Respectively represent the weight coefficients of the mean and variance parameters corresponding to each different normalization method.
[0075] Step 3: Construct a PatchGAN discriminator network that divides the image into receptive field blocks.
[0076] In this embodiment, refer to Figure 3 The discriminator network mainly distinguishes the generated image from the real image. Considering the image style transfer field with high resolution and high definition, the discriminator of ordinary GAN is not applicable. The present invention uses the discriminator structure of PatchGAN, uses the receptive field block to divide the input image into M×M blocks, and maps the pseudo M×M matrix X, X ij The value of represents the probability that the receptive field block is a true sample. ij The averaged output is used as the final output of the discriminator, where M affects the fineness of the image division, indicating that the input image is divided into M columns in the width direction and M rows in the height direction using the receptive field block, 0≤i<M, 0≤j<M.
[0077] Step 4: Construct a joint loss function by combining adversarial loss based on Wasserstein distance and feature loss based on cycle consistency.
[0078] In this embodiment, the two adversarial loss functions based on Wasserstein distance are expressed as follows: Figure 4 Adversarial loss function for training the upper and lower half loops in a cyclic generative adversarial network.
[0079]
[0080]
[0081] Among them G X , D X is the deblurring generator and clear discriminator obtained after training, G Y , D Y are the fuzzy generator and fuzzy discriminator, x, y, z are the data distribution of clear image, fuzzy image and penalty domain respectively, λ is the penalty factor, and the gradient is made as close to 1 as possible through back propagation optimization, E represents the mean operation, Indicates D X (z) Find the 2-norm distance after the gradient in the z direction.
[0082] In this embodiment, the improved cyclic generative adversarial network simultaneously learns G X and G YThe two generators can realize the mutual conversion between blurred images and clear images, ensuring that the images generated by the generator have high feature similarity with the input images. The cycle consistency loss is expressed as:
[0083]
[0084] In this embodiment, the composite loss function of the overall network is expressed as:
[0085]
[0086] in It is the weight used to balance the adversarial loss based on Wasserstein distance and the cycle consistency loss.
[0087] Step 5: According to the generator network and discriminator network obtained in steps 2 and 3, two mirrored ring GAN networks are constructed to cooperate with each other to obtain a cyclic generative adversarial network model, including a deblurring generator, a fuzzy generator, a clear discriminator and a fuzzy discriminator.
[0088] In this embodiment, refer to Figure 4 , the upper half of the figure shows the process of applying the trained deblur generator to complete the deblurring process. The lower half of the figure shows the training process of the cyclic generative adversarial network. The two mirrored ring-shaped generative adversarial networks cooperate with each other to ensure that the input and output of the overall network are as similar as possible. For a single network:
[0089] Step 5-1: Input a real clear picture into the improved cyclic generative adversarial network to train the discriminator;
[0090] Step 5-2: Input the real blurred image through the deblurring generator G X , converted into a pseudo-clear image and sent to the clear discriminator D X , and fed back to the deblurring generator G X , improve the authenticity of the images generated by the generator;
[0091] Step 5-3: The generated pseudo-clear image passes through the blur generator G Y , converting it into a pseudo-blurred image. At this time, the cycle consistency loss between the generated pseudo-blurred image and the real blurred image is calculated to ensure that the deblurring process does not lose the features of the original image;
[0092] Step 5-4: Repeat until the network converges and retain the first defuzzified generator G X spare.
[0093] Similar to the above process, a clear image is input and passed through another single network. The two networks are trained alternately to form a closed-loop cyclic generative adversarial network. After the network training converges, two usable generator models are obtained: a de-motion blur model and a simulated motion blur model. The first de-blurring generator is retained to clarify motion blur photos taken by hand.
[0094] Step 6: Input the motion blurred image to be processed into the deblurring generator trained in step 5 to obtain a preliminarily deblurred image.
[0095] In this embodiment, Figure 5 This is a set of comparisons of images blurred by motion, images after deblurring network and clear images, and shows the comparison of results after recognition. It can be intuitively compared that the blurred image has improved in details such as contour, texture and color after passing through the deblurring network. YOLO is an object recognition and positioning algorithm based on deep neural network. It runs very fast and can be used to recognize targets in real time. When evaluating the deblurring effect, we introduced YOLOv3. In the comparison of recognition results, the recognition average precision mAP (mean average precision) results in three types of images with different blur levels can be compared to show that the recognition accuracy of targets in deblurred images has been significantly improved, and target objects in the distance can be recognized.
[0096] Step 7, performing a two-dimensional Fourier transform on the preliminary deblurred image obtained in step 6, filtering out high-frequency bright spot spectrum information to obtain an accurate and clear image.
[0097] In this embodiment, refer to Figure 6 , the image is subjected to a two-dimensional Fourier transform. The high-frequency information of the deblurred image is clearer than that of the motion blurred image. This also explains why the details of the deblurred image in the time domain are enhanced, achieving the deblurring effect. However, compared with the clear original image, the motion blurred image has high-frequency spectrum components that do not exist in the original image, all located in the center of the four quadrants of the spectrum image, which is a pseudo-enhancement after the deblurring network.
[0098] The key to post-processing of deblurred images is to extract and filter out the over-enhanced bright spot spectrum information. The spectrum distribution of its two-dimensional Fourier transform is as follows: Figure 7 shown.
[0099] The image after filtering transformation (refer to Figure 8), although the subjective clarity of the original deblurred image has slightly decreased, it is still significantly improved compared to the original blurred image, and some pseudo-recognitions caused by over-enhancement have been removed. The left and right images recognize "person" next to "motorbike" and "truck" in the original deblurred image, respectively, which is a pseudo-recognition result. After filtering and removing the spectrum information of the image highlights, the recognition result is different from the clear original image. Figure 1 No false recognition results occur, which enhances the accuracy of the defuzzification network and improves the security of the system.
[0100] The present invention provides a method for removing image motion blur based on an improved cyclic generative adversarial network. There are many methods and ways to implement the technical solution. The above is only one of the preferred implementations of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications should also be regarded as the scope of protection of the present invention. All components not specified in this embodiment can be implemented using existing technologies.
Claims
1. A method for deblurring image motion based on an improved cyclic generative adversarial network, characterized in that: The following steps are involved: Step 1, select a blurry-clear image dataset and construct an unpaired blurry-clear dataset as a training dataset and a test dataset; Step 2: construct a generator network, which includes an encoder module, a feature converter module, and a decoder module; Step 3, construct a PatchGAN discriminator network that divides the image into receptive field blocks; Step 4, construct a joint loss function by using the adversarial loss function based on Wasserstein distance and the feature loss of cycle consistency; Step 5, constructing two mirrored ring-shaped generative adversarial networks (GANs) according to the generator network and the discriminator network obtained in step 2 and step 3 to cooperate with each other, and obtaining a cyclic generative adversarial network model, including a deblurring generator, a fuzzy generator, a clear discriminator, and a fuzzy discriminator; Step 6, inputting the motion blurred image to be processed into the deblurring generator trained in step 5 to obtain a preliminary deblurred image; Step 7, performing a two-dimensional Fourier transform on the preliminary deblurred image obtained in step 6, filtering out the redundant high-frequency bright spot spectrum components generated by over-enhancement, and obtaining an accurate and clear image; In step 2, the encoder module consists of three convolutional neural network layers, each convolution layer uses a switchable normalization layer and a ReLU activation function; the convolution kernel size of the first downsampling layer is 7×7, the convolution step size is 1, and the number of convolution kernels is 64; the convolution kernel size of the second downsampling layer is 3×3, the convolution step size is 2, and the number of convolution kernels is 128; the convolution kernel size of the third downsampling layer is 3×3, the convolution step size is 2, and the number of convolution kernels is 256; The feature converter module consists of nine layers of residual network blocks, each convolution layer uses a switchable normalization layer and a ReLU activation function; the convolution kernel size is 3×3, the convolution step is 1, and the number of convolution kernels is 256; The decoder module consists of three convolutional neural network layers, each of which uses a switchable normalization layer and a ReLU activation function; the first and second layers are transposed convolution layers, with a convolution kernel size of 1×1, a convolution step of 2, and 128 convolution kernels; the third layer is a convolution layer, with a convolution kernel size of 7×7, a convolution offset of 1, and 64 convolution kernels; Step 4 establishes an adversarial loss function based on Wasserstein distance, which is expressed as follows: Among them G X , D X is the deblurring generator and clear discriminator obtained after training, G Y , D Y are the fuzzy generator and fuzzy discriminator, x, y, z are the clear image data distribution, fuzzy image data distribution and penalty domain data distribution respectively, λ is the penalty factor, E represents the mean operation, Indicates D X (z) find the 2-norm distance after the gradient in the z direction; Step 4 establishes the feature loss function of cycle consistency, which is expressed as follows: Among them G X and G Y is a generator network that generates sharp and blurred images; Step 4 constructs the joint loss function, which is expressed as follows: in It is used to balance the weight of adversarial loss and cycle consistency loss based on Wasserstein distance; Step 5 includes the following sub-steps: Step 5-1: Input a real clear picture into the improved cyclic generative adversarial network to train the discriminator; Step 5-2: Input the real blurred image through the deblurring generator G X , converted into a pseudo-clear image and sent to the clear discriminator D X , and fed back to the deblurring generator G X , improve the authenticity of the images generated by the generator; Step 5-3: The generated pseudo-clear image passes through the blur generator G Y , converting it into a pseudo-blurred image. At this time, the cycle consistency loss between the generated pseudo-blurred image and the real blurred image is calculated to ensure that the deblurring process does not lose the features of the original image; Step 5-4: Repeat until the network converges and retain the first defuzzified generator G X spare.
2. The method for removing image motion blur based on an improved cyclic generative adversarial network according to claim 1 is characterized in that: Step 1: Randomly rotate the selected blurry-clear image dataset along the x-axis, y-axis and z-axis to simulate the real scene of handheld shooting. The random rotation angle meets the following constraints: Among them, α, β, γ represent the angular differences between the camera coordinate system and the world coordinate system on the x-axis, y-axis, and z-axis, respectively, and λ1, λ2, and λ3 are random deformation factors.
3. The image motion blur removal method based on improved cyclic generative adversarial network according to claim 1 is characterized in that: The discriminator network described in step 3 uses the receptive field block to divide the input image into M×M blocks and map them into an M×M matrix X, X ij represents the probability that the receptive field block in the i-th row and j-th column is a true sample. ij The averaged output is used as the final output of the discriminator; where M affects the fineness of the image division, indicating that the input image is divided into M columns in the width direction and M rows in the height direction using the receptive field block, 0≤i <M,0≤j<M。 4. The method for removing image motion blur based on an improved cyclic generative adversarial network according to claim 1, characterized in that: Step 7 includes the following sub-steps: Step 7-1: Perform a two-dimensional Fourier transform on the original clear image to obtain an image frequency domain result of the original clear image; Step 7-2: Perform a two-dimensional Fourier transform on the preliminary deblurred image after the deblurring generator to obtain an image frequency domain result of the preliminary deblurred image; Step 7-3: extracting high-frequency bright spot information newly appearing in the image frequency domain result of the initial deblurred image at the high-frequency information in the image frequency domain result compared with the image frequency domain result of the original clear image; Step 7-4: Perform a filtering transformation on the highlight information of the preliminary deblurred image.
5. The method for removing image motion blur based on improved cyclic generative adversarial network according to claim 1, characterized in that: The blurry-clear image dataset in step 1 adopts the publicly available GOPRO_Large dataset, which includes street view images taken by a high-frame camera and artificially synthesized blurry images.
