Image deblurring method and system based on atrous double residual multi-scale deep network
Through the atrous dual-residual multi-scale deep network combined with multi-scale feature fusion and wavelet reconstruction technology, the problems of poor image deblurring and loss of texture details in the existing technology are solved, and high-quality clear image reconstruction is achieved.
Patent Information
- Application Number
- CN202210335774.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-03-31
AI Technical Summary
Existing image deblurring methods have poor results when processing blurred images of varying degrees, especially in the loss of texture details, and cannot be applied to all types of blurring situations, resulting in unsatisfactory clear image reconstruction results.
An image deblurring method based on dilated double residual multi-scale deep network is adopted. Through the multi-scale codec structure, dilated double residual module and wavelet reconstruction module, combined with multi-scale feature fusion and frequency domain reconstruction technology, the network parameters are optimized to improve Deblurring performance.
Significantly improves the performance of image deblurring, retains more image texture details, reconstructs high-quality clear images, is suitable for different degrees of blur, and enhances the ability to restore texture details.
Smart Images

Figure CN114723630B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing and computer vision, and specifically relates to an image deblurring method and system based on a hole double residual multi-scale deep network. Background Art
[0002] With the development of science and technology and the widespread popularity of shooting equipment, the acquisition and dissemination of images has become an indispensable part of people's daily lives. However, even with the advanced camera technology today, we still inevitably encounter the problem of blurring artifacts in the photos due to camera shake or object movement, which makes the generated pictures of poor quality and loses a lot of detail information, thus affecting the subsequent high-level visual tasks of the pictures, such as image classification, object detection, semantic segmentation, etc. Therefore, the image deblurring task is crucial, which aims to restore the corresponding clear image from the blurred image, which has important research value in the field of computer vision.
[0003] Image clarity is particularly important for many advanced visual understanding tasks. Once there are a lot of blurs and artifacts in the image, it will greatly affect the computer's understanding of the image and hinder the effective transmission of information. In real life, blurred images also affect the development of industries such as medicine, monitoring, and photo beauty, causing great trouble to our lives. Therefore, image deblurring has attracted the attention of many researchers, and many advanced deblurring algorithms have been proposed one after another. Image deblurring problems are generally divided into non-blind deblurring and blind deblurring according to whether the blur kernel is known or unknown. Non-blind deblurring requires the assumption that the blur kernel information is uniformly distributed and known, while the blur in real scenes is non-uniformly changing and unknowable. Blind deblurring assumes that the blur kernel is unknown, and the final deblurred image is obtained by calculating the blur kernel function and estimating the clear image. Blind deblurring methods can also be divided into two categories: traditional methods and deep learning-based methods.
[0004] Most traditional deblurring methods are calculated based on the prior information of the image. By introducing a large amount of prior or statistical information of the image as a regularization term, the blur kernel is iteratively estimated, and then a clear image is solved by the deconvolution method. This type of method cannot be well applied to all types of blurred images, and the calculation is complex and the effect is poor, which makes it difficult to be applied to practical scenes. The method based on deep learning is a data-driven method. Its powerful feature learning representation ability can better extract the features of the image, and the computational complexity is much lower than that of traditional methods. Therefore, it is widely used in image deblurring tasks. However, there are some problems with the current learning-based methods, that is, the deblurring effect is not good, artifacts are easily generated, and texture details need to be optimized. In addition, the range of image blur is large and small. At present, many methods cannot be applied to all blurry situations, that is, they do a good job in reconstructing clear edges in small blurs, but they do not perform well in large blurs, or they work well in large blurs, but cannot restore clear texture details when dealing with small blurs. In view of these problems, how to design an effective and practical image deblurring method has become one of the hot topics of researchers. Summary of the invention
[0005] The purpose of the present invention is to provide an image deblurring method and system based on a void dual residual multi-scale deep network, which is conducive to improving the performance of image deblurring, removing image blur while retaining more image texture details, and reconstructing a high-quality clear image.
[0006] To achieve the above density, the technical solution adopted by the present invention is: an image deblurring method based on a hole double residual multi-scale deep network, comprising the following steps:
[0007] Step A, preprocessing the training image pairs of the original blurred degraded image and the clean image to obtain an image block data set consisting of the training image pairs of the original blurred degraded image and the clean image;
[0008] Step B, constructing a hole double residual multi-scale deep network for image deblurring, wherein the hole double residual multi-scale deep network adopts a multi-scale encoder-decoder structure design, including multiple hole double residual modules and a wavelet reconstruction module;
[0009] Step C, constructing a target loss function loss for optimizing the network, taking the image block data set as training data, and calculating the gradient of each parameter in the atrous double residual multi-scale deep network by the back propagation method according to the target loss function loss, and updating the parameters by the stochastic gradient descent method, and finally learning the optimal parameters of the atrous double residual multi-scale deep network;
[0010] Step D: input the image to be tested into the trained atrous double residual multi-scale deep network to predict and generate a clean image after blurring is removed.
[0011] Furthermore, the specific implementation method of step A is as follows: the original blurred degraded image and its corresponding clean image are cut into blocks in a consistent manner to obtain image blocks of size H×W, and in order to avoid overlapping cutting, cutting is performed every m pixels; after cutting, the blurred image blocks of size H×W and the clean image blocks of size H×W correspond one to one, and then each group of paired image blocks obtained are subjected to the same random flipping and rotation, and the data is enhanced to obtain paired blurred image and clean image blocks for training; wherein the blurred image in each group of paired image blocks is the input, and the clean image is the reference image.
[0012] Furthermore, the specific implementation steps of step B are as follows:
[0013] Step B1: construct a hollow double residual block, which is formed by stacking multiple hollow double residual modules to increase the receptive field, obtain more image context information and retain more detailed edge information;
[0014] Step B2: construct a wavelet reconstruction module to compensate for texture details lost due to repeated up- and down-sampling in the codec structure, thereby reconstructing a more refined restored image;
[0015] Step B3: construct a dilated double residual multi-scale deep network, which adopts a multi-scale encoder-decoder design and introduces an asymmetric feature fusion structure to more effectively fuse multi-scale features.
[0016] Furthermore, in step B1, the implementation method of the hollow double residual block is:
[0017] In the atrous double residual multi-scale deep network, each layer of the encoder and decoder includes a atrous double residual block, which is formed by stacking multiple atrous double residual modules;
[0018] Each dilated double residual module includes two convolutional layers with a convolution kernel of 3×3 and one dilated convolutional layer. The feature information does not change the size of the feature after passing through the dilated double residual module. The module can increase the network receptive field, obtain more image context information and retain more detailed edge information.
[0019] The atrous double residual module uses residual connections to connect the input features and module output features, and constructs a residual connection in the atrous convolution layer inside the module. Specifically, the atrous double residual module is calculated according to the following formula:
[0020] F out=Conv2(ReLU(Dilated(ReLU(Conv1(F in ))))+ReLU(Conv1(F in )))+F in
[0021] Among them, Conv1(*) and Conv2(*) represent two convolutional layers with 3×3 convolution kernels, Dilated(*) represents a hole convolutional layer, and F in and F out They represent the input and output features of the dilated double residual module respectively, where ReLU() represents the ReLU activation function.
[0022] Furthermore, in step B2, the implementation method of the wavelet reconstruction module is:
[0023] The wavelet reconstruction module is used to compensate for the texture details lost due to repeated up and down sampling in the codec structure, so as to reconstruct a more refined restored image. The wavelet reconstruction module mainly uses wavelet transform to convert spatial domain information into wavelet frequency domain for restoration; through discrete wavelet transform, the input feature F in Divided into four different frequency sub-bands, the calculation formula is as follows:
[0024] (F LL , F LH , F HL , F HH )=DWT(F in )
[0025] Where DWT(*) is the discrete wavelet transform operation; F LL , F LH , F HL , F HH Respectively represent the characteristics of the four frequency sub-bands; in order to avoid interference between different frequency sub-bands, the four sub-bands are restored through three convolution layers with a convolution kernel of 3×3; the calculation formula is as follows:
[0026] R LL =C3(F LL )
[0027] R LH =C3(F LH )
[0028] R HL =C3(F HL )
[0029] R HH =C3(F HH )
[0030] Among them, C3(*) represents a three-layer 3×3 convolutional network; R LL , R LH , R HL , R HH represents the four frequency sub-band features recovered by the three-layer convolutional network; finally, the recovered frequency sub-bands are reconstructed into output features D using inverse discrete wavelet transform. out ; The calculation formula is as follows:
[0031] D out =IDWT(R LL , R LH , R HL , R HH )
[0032] Where IDWT(*) represents the inverse discrete wavelet transform operation;
[0033] In the wavelet reconstruction stage, the output feature DB1 of the previous step is divided into two branches. The first branch inputs DB1 into the deconvolution layer with a convolution kernel of 3×3 to restore the number of channels to 3 to obtain the output DB out The second branch inputs DB1 into the wavelet reconstruction module to obtain an output D of size H×W×3 out , and then DB out , D out And the original input blurred image block In1 are added to get the output image output; the calculation formula is as follows:
[0034] output=DB out +D out +In1.
[0035] Furthermore, in step B3, the implementation method of the atrous double residual multi-scale deep network is:
[0036] Step B31, in the encoder stage, the atrous double residual multi-scale deep network adopts a three-layer encoder-decoder design; the first encoder input is a blurred image block In1 of size H×W×3, and after a convolution layer with a convolution kernel of 3×3 and a atrous double residual block, an output EB1 of size H×W×C is obtained; the second encoder input is a blurred image block In1 that is downsampled twice to obtain an output EB1 of size The feature map In2 and the output EB1 of the previous encoder are obtained after the feature extraction attention module and the hollow double residual block. The output EB2 of EB2 is obtained; then EB2 and the blurred image block In1 are downsampled four times to obtain a size of The feature map In3 is input to the third encoder, and after the feature extraction attention module and the hollow double residual block, the size is Output EB3;
[0037] In the feature extraction attention module, the input downsampled blurred feature map first passes through a convolution layer with a convolution kernel of 3×3 and a convolution layer with a convolution kernel of 1×1 for shallow feature extraction. The output of the previous encoder is downsampled through a convolution layer with a convolution kernel of 3×3. Then the two are multiplied and passed through a channel space attention module CBAM, and then added pixel by pixel with the output of the encoder obtained after downsampling to obtain the result;
[0038] Step B32, in the decoder stage, the feature map EB3 obtained in step B31 is input into the first decoder, and the output DB3 is obtained after passing through the hole double residual block and the deconvolution layer. The input of the second decoder is the three encoder outputs EB1, EB2, EB3 obtained in step B31 and the output DB3 of the previous decoder. The four inputs are feature fused through the multi-scale feature fusion module, and then pass through the hole double residual block and the deconvolution layer in turn to obtain the output DB2. Similarly, the last decoder input is EB1, EB2, EB3 and the output DB2 of the previous decoder, and the output DB1 of size H×W×C is obtained after passing through the multi-scale feature fusion module and the hole double residual block; the output DB1 passes through the deconvolution layer and the wavelet reconstruction module respectively to obtain the output DB out , D out , and finally DB out , D out Add it to the original input blurred image block In1 to get the final output image output, that is, the deblurred image;
[0039] In the multi-scale feature fusion module, the input is the output of the three encoders EB1, EB2, EB3 and the output DB of the previous decoder t-1 EB1, EB2, and EB3 are upsampled and downsampled to become feature maps of the same size, and then the channels are spliced and passed through a convolution layer with a convolution kernel of 3×3 and a convolution layer with a convolution kernel of 1×1 to fuse the features, and then combined with DB t-1 After channel splicing, the final output is obtained through a convolution layer with a convolution kernel of 1×1. Specifically, the multi-scale feature fusion module is calculated according to the following formula:
[0040] F t =Conv1(Concat(Conv3(Conv1(Concat(R(EB1),R(EB2),R(EB3)))),DB t-1 ))
[0041] Among them, R(*) represents up and down sampling, Concat(*) represents channel concatenation operation, Conv3(*) represents 3×3 convolution layer, Conv1(*) represents 1×1 convolution layer, and F t is the feature after fusion of the t-th decoder, DB t-1 Represents the output of the previous decoder, EB i Represents the output of the i-th encoder.
[0042] Furthermore, the specific implementation steps of step C are as follows:
[0043] Step C1, construct a loss function as a constraint to optimize the atrous double residual multi-scale deep network model. The specific formula is as follows:
[0044] Loss total =Loss cont +λLoss MSFR
[0045] Among them, Loss total Expressed as the total loss function; Loss cont Expressed as a multi-scale content loss function; Loss MSFR It is expressed as the multi-scale frequency reconstruction loss function; λ is the weight of the loss; specifically, Loss cont The calculation formula of content loss is as follows:
[0046]
[0047] Among them, ||*||1 means L1 distance, i.e. taking the absolute value, where k=1,…,K, K is the total number of samples of training data, S k represents the clean image block corresponding to the kth blurred image block of the input, Represents the deblurred image block predicted by the network;
[0048] The multi-scale frequency reconstruction loss function optimizes the frequency domain gap between the predicted image and the blurred image; Loss MSFR The specific calculation formula is as follows:
[0049]
[0050] in, Indicates the conversion of image signal into frequency domain fast Fourier transform;
[0051] Step C2: randomly divide the image block data set into several batches, each batch contains the same number of image blocks, and train and optimize the designed network until the Loss value calculated in step C1 converges to the threshold or the number of iterations reaches the threshold, save the trained network model, and complete the network training process.
[0052] Furthermore, in step D, the original blurred image for testing is input into the network model trained in step C to calculate and obtain the final deblurred image.
[0053] The present invention also provides an image deblurring system based on a void dual residual multi-scale deep network, comprising a memory, a processor, and computer program instructions stored in the memory and capable of being executed by the processor. When the processor executes the computer program instructions, the above-mentioned method steps can be implemented.
[0054] Compared with the prior art, the present invention has the following beneficial effects: providing an image deblurring method and system based on a hole double residual multi-scale deep network to solve the problems of image texture detail loss, inability to effectively handle different degrees of blur range and poor deblurring effect existing in the existing deep learning deblurring model. The present invention adopts a jump connection of multi-scale feature fusion to effectively merge multi-scale features and obtain blur kernel information of different levels. At the same time, the method constructs a hole double residual module, uses hole convolution to increase the receptive field to extract features of different scales, and the double residual structure can strengthen the feature information exchange between each level, thereby retaining more local features. In addition, in view of the problem of texture detail loss caused by repeated up and down sampling in the codec structure, a wavelet reconstruction module is introduced, and the frequency domain characteristics of the wavelet transform are used to provide additional information for spatial domain reconstruction, so that the restored image contains more high-frequency details. The method can significantly improve the performance of image deblurring, remove image blur while retaining more image texture details, and reconstruct a high-quality clear image. Therefore, the present invention has strong practicality and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a flow chart of the method implementation of the embodiment of the present invention.
[0056] Figure 2 2 is a schematic diagram of the structure of a dilated dual residual multi-scale deep network in an embodiment of the present invention.
[0057] Figure 3 It is a structural diagram of the feature extraction attention module in an embodiment of the present invention.
[0058] Figure 4 Schematic diagram of the structure of a multi-scale feature fusion module in an embodiment of the present invention.
[0059] Figure 5 2 is a schematic diagram of the structure of the hollow double residual module in an embodiment of the present invention.
[0060] Figure 6 Schematic diagram of the structure of the wavelet reconstruction module in the embodiment of the present invention. DETAILED DESCRIPTION
[0061] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0062] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0063] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0064] like Figure 1 As shown, this embodiment provides an image deblurring method based on a hole double residual multi-scale deep network, comprising the following steps:
[0065] Step A: preprocessing the training image pairs of the original blurred degraded image and the clean image to obtain an image block data set consisting of the training image pairs of the original blurred degraded image and the clean image.
[0066] Step B: constructing a hole double residual multi-scale deep network for image deblurring, wherein the hole double residual multi-scale deep network adopts a multi-scale encoder-decoder structure design, including multiple hole double residual modules and a wavelet reconstruction module.
[0067] Step C, constructing a target loss function loss for optimizing the network, taking the image block data set as training data, and calculating the gradient of each parameter in the atrous double residual multi-scale deep network by the back propagation method according to the target loss function loss, and updating the parameters by the stochastic gradient descent method, and finally learning the optimal parameters of the atrous double residual multi-scale deep network.
[0068] Step D: input the image to be tested into the trained atrous double residual multi-scale deep network to predict and generate a clean image after blurring is removed.
[0069] In this embodiment, the specific implementation method of step A is as follows: the original blurred degraded image and its corresponding clean image are cut into blocks in a consistent manner to obtain image blocks of size H×W, and in order to avoid overlapping cutting, the blocks are cut every m pixels; after cutting, the blurred image blocks of size H×W and the clean image blocks of size H×W correspond one to one, and then each group of paired image blocks obtained are subjected to the same random flipping and rotation, and the data is enhanced to obtain paired blurred image and clean image blocks for training; wherein the blurred image in each group of paired image blocks is the input, and the clean image is the reference image.
[0070] In this embodiment, the specific implementation steps of step B are as follows:
[0071] Step B1: construct a hollow double residual block, which is formed by stacking multiple hollow double residual modules to increase the receptive field, obtain more image context information and retain more detailed edge information.
[0072] like Figure 5 As shown, the implementation method of the hole double residual block is:
[0073] In the atrous double residual multi-scale deep network, a atrous double residual block is included in each layer of the encoder and decoder, which is formed by stacking multiple atrous double residual modules.
[0074] Each atrous double residual module consists of two convolutional layers with 3×3 convolution kernels and one atrous convolutional layer. The feature information does not change the size of the feature after passing through the atrous double residual module. The module can increase the network receptive field, obtain more image context information and retain more detailed edge information.
[0075] The atrous double residual module uses residual connections to connect the input features and module output features, and constructs a residual connection in the atrous convolution layer inside the module. Specifically, the atrous double residual module is calculated according to the following formula:
[0076] F out =Conv2(ReLU(Dilated(ReLU(Conv1(F in ))))+ReLU(Conv1(F in )))+F in
[0077] Among them, Conv1(*) and Conv2(*) represent two convolutional layers with 3×3 convolution kernels, Dilated(*) represents a hole convolutional layer, and F in and F out They represent the input and output features of the dilated double residual module respectively, where ReLU() represents the ReLU activation function.
[0078] Step B2: construct a wavelet reconstruction module to compensate for texture details lost due to repeated up and down sampling in the codec structure, so as to reconstruct a more refined restored image.
[0079] like Figure 6 As shown, the implementation method of the wavelet reconstruction module is:
[0080] The wavelet reconstruction module is used to compensate for the texture details lost due to repeated up and down sampling in the codec structure, so as to reconstruct a more refined restored image. The wavelet reconstruction module mainly uses wavelet transform to convert spatial domain information into wavelet frequency domain for restoration; through discrete wavelet transform, the input feature F in Divided into four different frequency sub-bands, the calculation formula is as follows:
[0081] (F LL , F LH , F HL , F HH )=DWT(F in )
[0082] Where DWT(*) is the discrete wavelet transform operation; F LL , F LH , F HL , F HH Respectively represent the characteristics of the four frequency sub-bands; in order to avoid interference between different frequency sub-bands, the four sub-bands are restored through three convolution layers with a convolution kernel of 3×3; the calculation formula is as follows:
[0083] R LL =C3(F LL )
[0084] R LH =C3(F LH )
[0085] R HL =C3(F HL )
[0086] R HH =C3(F HH )
[0087] Among them, C3(*) represents a three-layer 3×3 convolutional network; R LL , R LH , R HL , R HH Represents the four frequency subband features recovered by the three-layer convolutional network. Finally, the recovered frequency subbands are reconstructed into output features D using inverse discrete wavelet transform. out ; The calculation formula is as follows:
[0088] D out =IDWT(RLL , R LH , R HL , R HH )
[0089] Where IDWT(*) represents the inverse discrete wavelet transform operation.
[0090] In the wavelet reconstruction stage, the output feature DB1 of the previous step is divided into two branches. The first branch inputs DB1 into the deconvolution layer with a convolution kernel of 3×3 to restore the number of channels to 3 to obtain the output DB out The second branch inputs DB1 into the wavelet reconstruction module to obtain an output D of size H×W×3 out , and then DB out , D out And the original input blurred image block In1 are added to get the output image output; the calculation formula is as follows:
[0091] output=DB out +D out +In1.
[0092] Step B3: construct a dilated double residual multi-scale deep network, which adopts a multi-scale encoder-decoder design and introduces an asymmetric feature fusion structure to more effectively fuse multi-scale features.
[0093] like Figure 2 As shown, the implementation method of the hole double residual multi-scale deep network is:
[0094] Step B31, in the encoder stage, the atrous double residual multi-scale deep network adopts a three-layer encoder-decoder design; the first encoder input is a blurred image block In1 of size H×W×3, and after a convolution layer with a convolution kernel of 3×3 and a atrous double residual block, an output EB1 of size H×W×C is obtained; the second encoder input is a blurred image block In1 that is downsampled twice to obtain an output EB1 of size The feature map In2 and the output EB1 of the previous encoder are obtained after the feature extraction attention module and the hollow double residual block. The output EB2 of EB2 is obtained; then EB2 and the blurred image block In1 are downsampled four times to obtain a size of The feature map In3 is input to the third encoder, and after the feature extraction attention module and the hollow double residual block, the size is The output of EB3.
[0095] like Figure 3As shown in the figure, in the feature extraction attention module, the input downsampled blurred feature map first passes through a convolution layer with a convolution kernel of 3×3 and a convolution layer with a convolution kernel of 1×1 for shallow feature extraction, and the output of the previous encoder is downsampled through a convolution layer with a convolution kernel of 3×3. Then the two are multiplied and passed through a channel space attention module CBAM, and then added pixel by pixel with the output of the encoder obtained after downsampling to obtain the result.
[0096] Step B32, in the decoder stage, the feature map EB3 obtained in step B31 is input into the first decoder, and the output DB3 is obtained after passing through the hole double residual block and the deconvolution layer. The input of the second decoder is the three encoder outputs EB1, EB2, EB3 obtained in step B31 and the output DB3 of the previous decoder. The four inputs are feature fused through the multi-scale feature fusion module, and then pass through the hole double residual block and the deconvolution layer in turn to obtain the output DB2. Similarly, the last decoder input is EB1, EB2, EB3 and the output DB2 of the previous decoder, and the output DB1 of size H×W×C is obtained after passing through the multi-scale feature fusion module and the hole double residual block; the output DB1 passes through the deconvolution layer and the wavelet reconstruction module respectively to obtain the output DB out , D out , and finally DB out , D out Add it to the original input blurred image block In1 to get the final output image output, that is, the deblurred image.
[0097] like Figure 4 As shown in the multi-scale feature fusion module, the input is the output EB1, EB2, EB3 of the three encoders and the output DB of the previous decoder t-1 EB1, EB2, and EB3 are upsampled and downsampled to become feature maps of the same size, and then the channels are spliced and passed through a convolution layer with a convolution kernel of 3×3 and a convolution layer with a convolution kernel of 1×1 to fuse the features, and then combined with DB t-1 After channel splicing, the final output is obtained through a convolution layer with a convolution kernel of 1×1. Specifically, the multi-scale feature fusion module is calculated according to the following formula:
[0098] F t =Conv1(Concat(Conv3(Conv1(Concat(R(EB1),R(EB2),R(EB3)))),DB t-1 ))
[0099] Among them, R(*) represents up and down sampling, Concat(*) represents channel concatenation operation, Conv3(*) represents 3×3 convolution layer, Conv1(*) represents 1×1 convolution layer, and F t is the feature after fusion of the t-th decoder, DB t-1 Represents the output of the previous decoder, EB i Represents the output of the i-th encoder.
[0100] In this embodiment, the specific implementation steps of step C are as follows:
[0101] Step C1, construct a loss function as a constraint to optimize the atrous double residual multi-scale deep network model. The specific formula is as follows:
[0102] Loss total =Loss cont +λLoss MSFR
[0103] Among them, Loss total Expressed as the total loss function; Loss cont Expressed as a multi-scale content loss function; Loss MSFR It is expressed as the multi-scale frequency reconstruction loss function; λ is the weight of the loss; specifically, Loss cont The calculation formula of content loss is as follows:
[0104]
[0105] Among them, ||*||1 means L1 distance, i.e. taking the absolute value, where k=1,…,K, K is the total number of samples of training data, S k represents the clean image block corresponding to the kth blurred image block of the input, Represents the deblurred image patch predicted by the network.
[0106] Since the purpose of deblurring is to restore the lost high-frequency components, it is necessary to reduce the difference in frequency space. The multi-scale frequency reconstruction loss function can optimize the frequency domain gap between the predicted image and the blurred image. MSFR The specific calculation formula is as follows:
[0107]
[0108] in, Indicates the fast Fourier transform that converts the image signal into the frequency domain.
[0109] Step C2: randomly divide the image block data set into several batches, each batch contains the same number of image blocks, and train and optimize the designed network until the Loss value calculated in step C1 converges to the threshold or the number of iterations reaches the threshold, save the trained network model, and complete the network training process.
[0110] In this embodiment, in step D, the original blurred image for testing is input into the network model trained in step C to calculate and obtain the final deblurred image.
[0111] This embodiment provides an image deblurring system based on a void dual residual multi-scale deep network, including a memory, a processor, and computer program instructions stored in the memory and capable of being executed by the processor. When the processor executes the computer program instructions, the above-mentioned method steps can be implemented.
[0112] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0113] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0116] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. An image deblurring method based on a dilated dual residual multi-scale deep network, characterized in that: The following steps are involved: Step A, preprocessing the training image pairs of the original blurred degraded image and the clean image to obtain an image block data set consisting of the training image pairs of the original blurred degraded image and the clean image; Step B, constructing a hole double residual multi-scale deep network for image deblurring, wherein the hole double residual multi-scale deep network adopts a multi-scale encoder-decoder structure design, including multiple hole double residual modules and a wavelet reconstruction module; Step C, constructing a target loss function loss for optimizing the network, taking the image block data set as training data, and calculating the gradient of each parameter in the atrous double residual multi-scale deep network by the back propagation method according to the target loss function loss, and updating the parameters by the stochastic gradient descent method, and finally learning the optimal parameters of the atrous double residual multi-scale deep network; Step D: input the image to be tested into the trained atrous double residual multi-scale deep network to predict and generate a clean image after blurring is removed; The specific implementation steps of step B are as follows: Step B1: construct a hollow double residual block, which is formed by stacking multiple hollow double residual modules to increase the receptive field, obtain more image context information and retain more detailed edge information; Step B2: construct a wavelet reconstruction module to compensate for texture details lost due to repeated up- and down-sampling in the codec structure, thereby reconstructing a more refined restored image; Step B3: constructing a dilated double residual multi-scale deep network, wherein the dilated double residual multi-scale deep network adopts a multi-scale encoder-decoder design and introduces an asymmetric feature fusion structure to more effectively fuse multi-scale features; In step B1, the implementation method of the hollow double residual block is: In the atrous double residual multi-scale deep network, each layer of the encoder and decoder includes a atrous double residual block, which is formed by stacking multiple atrous double residual modules; Each dilated double residual module includes two convolutional layers with a convolution kernel of 3×3 and one dilated convolutional layer. The feature information does not change the size of the feature after passing through the dilated double residual module. The module can increase the network receptive field, obtain more image context information and retain more detailed edge information. The atrous double residual module uses residual connections to connect the input features and module output features, and constructs a residual connection in the atrous convolution layer inside the module. Specifically, the atrous double residual module is calculated according to the following formula: F out =Conv2(ReLU(Dilated(ReLU(Conv1(F in ))))+ReLU(Conv1(F in )))+F in Among them, Conv1(*) and Conv2(*) represent two convolutional layers with 3×3 convolution kernels, Dilated(*) represents a hole convolutional layer, and F in and F out They represent the input and output features of the dilated double residual module, respectively, where ReLU() represents the Relu activation function; In step B2, the implementation method of the wavelet reconstruction module is: The wavelet reconstruction module is used to compensate for the texture details lost due to repeated up and down sampling in the codec structure, so as to reconstruct a more refined restored image. The wavelet reconstruction module mainly uses wavelet transform to convert spatial domain information into wavelet frequency domain for restoration; through discrete wavelet transform, the input feature F in Divided into four different frequency sub-bands, the calculation formula is as follows: (F LL ,F LH ,F HL ,F HH )=DWT(F in ) Where DWT(*) is the discrete wavelet transform operation; F LL , F LH , F HL , F HH Respectively represent the characteristics of the four frequency sub-bands; in order to avoid interference between different frequency sub-bands, the four sub-bands are restored through three convolution layers with a convolution kernel of 3×3; the calculation formula is as follows: R LL =C3(F LL ) R LH =C3(F LH ) R HL =C3(F HL ) R HH =C3(F HH ) Among them, C3(*) represents a three-layer 3×3 convolutional network; R LL , R LH , R HL , R HH represents the four frequency sub-band features recovered by the three-layer convolutional network; finally, the recovered frequency sub-bands are reconstructed into output features D using inverse discrete wavelet transform. out ; The calculation formula is as follows: D out =IDWT(R LL ,R LH ,R HL ,R HH ) Where IDWT(*) represents the inverse discrete wavelet transform operation; In the wavelet reconstruction stage, the output feature DB1 of the previous step is divided into two branches. The first branch inputs DB1 into the deconvolution layer with a convolution kernel of 3×3 to restore the number of channels to 3 to obtain the output DB out The second branch inputs DB1 into the wavelet reconstruction module to obtain an output D of size H×W×3 out , and then DB out D out And the original input blurred image block In1 are added to get the output image output; the calculation formula is as follows: outout=DB out +D out +In1 In step B3, the implementation method of the atrous double residual multi-scale deep network is: Step B31, in the encoder stage, the atrous double residual multi-scale deep network adopts a three-layer encoder-decoder design; the first encoder input is a blurred image block In1 of size H×W×3, and after a convolution layer with a convolution kernel of 3×3 and a atrous double residual block, an output EB1 of size H×W×C is obtained; the second encoder input is a blurred image block In1 that is downsampled twice to obtain an output EB1 of size The feature map In2 and the output EB1 of the previous encoder are obtained after the feature extraction attention module and the hollow double residual block. The output EB2 of EB2 is obtained; then EB2 and the blurred image block In1 are downsampled four times to obtain a size of The feature map In3 is input to the third encoder, and after the feature extraction attention module and the hollow double residual block, the size is Output EB3; In the feature extraction attention module, the input downsampled blurred feature map first passes through a convolution layer with a convolution kernel of 3×3 and a convolution layer with a convolution kernel of 1×1 for shallow feature extraction. The output of the previous encoder is downsampled through a convolution layer with a convolution kernel of 3×3. Then the two are multiplied and passed through a channel space attention module CBAM, and then added pixel by pixel with the output of the encoder obtained after downsampling to obtain the result; Step B32, in the decoder stage, the feature map EB3 obtained in step B31 is input into the first decoder, and the output DB3 is obtained after passing through the hole double residual block and the deconvolution layer. The input of the second decoder is the three encoder outputs EB1, EB2, EB3 obtained in step B31 and the output DB3 of the previous decoder. The four inputs are feature fused through the multi-scale feature fusion module, and then pass through the hole double residual block and the deconvolution layer in turn to obtain the output DB2. Similarly, the last decoder input is EB1, EB2, EB3 and the output DB2 of the previous decoder, and the output DB1 of size H×W×C is obtained after passing through the multi-scale feature fusion module and the hole double residual block; the output DB1 passes through the deconvolution layer and the wavelet reconstruction module respectively to obtain the output DB out , D out , and finally DB out , D out Add it to the original input blurred image block In1 to get the final output image output, that is, the deblurred image; In the multi-scale feature fusion module, the input is the output of the three encoders EB1, EB2, EB3 and the output DB of the previous decoder t-1 EB1, EB2, and EB3 are upsampled and downsampled to become feature maps of the same size, and then the channels are spliced and passed through a convolution layer with a convolution kernel of 3×3 and a convolution layer with a convolution kernel of 1×1 to fuse the features, and then combined with DB t-1 After channel splicing, the final output is obtained through a convolution layer with a convolution kernel of 1×1. Specifically, the multi-scale feature fusion module is calculated according to the following formula: F t =Conv1(Concat((Conv3(Conv1(Concat(R(EB1),R(EB2),R(EB3)))),DB t-1 )) Among them, R(*) represents up and down sampling, Concat(*) represents channel concatenation operation, Conv3(*) represents 3×3 convolution layer, Conv1(*) represents 1×1 convolution layer, and F t is the feature after the t-th decoder is fused, DB t-1 Represents the output of the previous decoder, EB i represents the output of the i-th encoder; The specific implementation steps of step C are as follows: Step C1, construct a loss function as a constraint to optimize the atrous double residual multi-scale deep network model. The specific formula is as follows: Loss total =Loss cont +Loss MSFR Among them, Loss total Expressed as the total loss function; Loss cont Expressed as a multi-scale content loss function; Loss MSPR It is expressed as the multi-scale frequency reconstruction loss function; λ is the weight of the loss; specifically, Loss cont The calculation formula of content loss is as follows: Among them, ||*||1 represents the absolute value of the l1 distance, where k=1,…,K, K is the total number of samples of the training data, S k represents the clean image block corresponding to the kth blurred image block of the input, Represents the deblurred image block predicted by the network; The multi-scale frequency reconstruction loss function optimizes the frequency domain gap between the predicted image and the blurred image; Loss MSFR The specific calculation formula is as follows: in, Indicates the conversion of image signal into frequency domain fast Fourier transform; Step C2: randomly divide the image block data set into several batches, each batch contains the same number of image blocks, and train and optimize the designed network until the Loss value calculated in step C1 converges to the threshold or the number of iterations reaches the threshold, save the trained network model, and complete the network training process.
2. The image deblurring method based on a dilated dual residual multi-scale deep network according to claim 1, characterized in that: The specific implementation method of step A is as follows: the original blurred degraded image and its corresponding clean image are cut into blocks in a consistent manner to obtain image blocks of size J×W, and in order to avoid overlapping cutting, the blocks are cut every m pixels; after cutting, the blurred image blocks of size J×W correspond to the clean image blocks of size H×W one by one, and then each group of paired image blocks obtained are randomly flipped and rotated in the same way, and the data is enhanced to obtain paired blurred image and clean image blocks for training; wherein the blurred image in each group of paired image blocks is the input, and the clean image is the reference image.
3. The image deblurring method based on a dilated dual residual multi-scale deep network according to claim 1, characterized in that: In the step D, the original blurred image for testing is input into the network model trained in the step C, and the deblurred image is finally generated by calculation.
4. An image deblurring system based on a dilated dual residual multi-scale deep network, characterized in that: The method comprises a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, the method steps as described in any one of claims 1 to 3 can be implemented.
