An image deblurring algorithm based on knowledge distillation and deep neural network
By introducing knowledge distillation technology and deep neural network into the image deblurring algorithm, and using the teacher network to supervise the training of the student network, the problem of insufficient deblurring performance in complex spatial non-uniform blur scenes in the existing technology is solved, and a higher level of performance is achieved. Quality image deblurring and a more lightweight network structure.
Patent Information
- Application Number
- CN202210313655.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-03-28
AI Technical Summary
Existing image deblurring algorithms have limited performance in complex spatial non-uniform blur scenes, and algorithms based on deep neural networks have large network parameters, increased training difficulty, and lack of supervision and constraints on intermediate features, resulting in limited improvement in deblurring performance.
An image deblurring algorithm based on knowledge distillation and deep neural network is adopted. By constructing the teacher network and student network of Unet structure, the converged teacher network model is used to supervise the student network to enhance the supervision and constraints of the intermediate features, and adopt L1 loss. Function and frequency domain loss function are optimized to reduce the amount of network parameters and training difficulty.
While keeping the network parameters small and the forward operation time short, the image deblurring performance is significantly improved, a higher peak signal-to-noise ratio and structural similarity are obtained, and a clearer image is restored, which proves the power of knowledge distillation. Performance improvements in deep neural networks.
Smart Images

Figure CN114677304B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image deblurring in computer vision, and in particular relates to an image deblurring algorithm based on knowledge distillation and deep neural network. Background Art
[0002] Digital images are an important information carrier and are widely used in various fields, such as digital audio and video, remote sensing detection and traffic management. However, digital images are easily affected by various destructive factors during the acquisition, transmission and storage process, which leads to the degradation of digital image quality, and blurring is a major feature. Therefore, the study of digital image deblurring is of great significance and value.
[0003] Traditional image deblurring algorithms mainly model the image blurring process as a linear convolution model, and their solution model is mainly based on the Maximization of Posterior Probability Model (MAP) and Maximum Likelihood Estimation Model (MLE) to solve a minimized energy function. However, traditional deblurring algorithms are limited to limited scene types under the condition of spatial uniform blur, the image prior used has poor robustness, and the optimization model introduces non-convex and nonlinear constraint functions, which leads to large optimization process calculations and slow restoration speed, and does not have higher practical application value.
[0004] With the great success of deep neural networks in the field of computer vision, many studies have proposed applying deep neural networks to image deblurring. Considering that most real scenes are complex spatial non-uniform blur scenes, it is difficult to establish a suitable degradation model for them. Researchers try to use the powerful fitting ability of deep neural networks to directly learn a nonlinear mapping function from blurred images to clear images. This type of method is often used to solve complex spatial non-uniform deblurring problems (such as dynamic scene blur) and has achieved good restoration effects. The current image deblurring algorithms based on deep neural networks mainly include multi-scale convolutional neural networks, multi-image block hierarchical networks, GAN-based deep neural networks, and image prior-based deep neural networks. However, the existing image deblurring algorithms based on deep neural networks have a large number of overall network parameters. Simply deepening the network depth will make the network training more difficult. The lack of supervision and constraints on intermediate features during network training ultimately leads to limited improvement in deblurring performance. At the same time, when faced with complex and changeable spatial non-uniform blur, the restoration effect of this type of algorithm is still limited. Summary of the invention
[0005] The present invention aims to provide an image deblurring algorithm based on knowledge distillation and deep neural network, so as to solve the technical problems that the existing image deblurring algorithm does not have higher practical application value and the existing image deblurring algorithm based on deep neural network has limited improvement in deblurring performance.
[0006] In order to solve the above technical problems, the specific technical solutions of the present invention are as follows:
[0007] An image deblurring algorithm based on knowledge distillation and deep neural network includes the following steps:
[0008] Step S1: construct an end-to-end deep neural network model based on the Unet structure, namely the teacher network model;
[0009] Step S2: Obtain a fuzzy image data set, use the clear image set in the fuzzy image data set to perform supervised training on the teacher network model, and then obtain a converged teacher network model, which takes the high-definition image as input, outputs multiple intermediate features through forward operation, and obtains a restored high-definition image;
[0010] Step S3: construct an end-to-end image deblurring model based on Unet structure and deformable convolution, namely, the student network model;
[0011] Step S4: Based on the blurred image data set in step S2, the intermediate feature output of the student network model is supervised and trained using the converged teacher network model in step S2, thereby obtaining a converged student network model. The converged student network model takes the blurred image as input and outputs a reconstructed deblurred image through forward operation.
[0012] Furthermore, the step S2 specifically includes the following steps:
[0013] Step S201: Obtain a public blurred image dataset GOPRO, divide the dataset GOPRO into a training set, a validation set and a test set, each of which includes 2000 pairs of training image pairs, 103 pairs of validation image pairs and 1111 pairs of test image pairs; only use the real clear images of the training set to train the teacher network model;
[0014] Step S202: In the data preprocessing stage, randomly crop an image block with a resolution of 256*256 from the original real clear image, perform random horizontal and vertical flipping data enhancement processing on the image block, and then normalize the image block and input it into the teacher network model for training;
[0015] Step S203: The input clear image is subjected to encoder network feature extraction, decoder network feature reconstruction, and finally feature fusion to obtain a reconstructed clear image;
[0016] Step S204: using L1 loss function to supervise the teacher network training;
[0017] Step S205: The trained teacher network model performs forward operation on the input clear image to obtain multiple decoding feature maps of different scales of the clear image, and finally outputs a restored clear image, wherein these intermediate decoding feature maps are used for subsequent supervision and training of the student network model.
[0018] Furthermore, the step S4 specifically includes the following steps:
[0019] Step S401: using the data set GOPRO divided in step S2 as a training set, a validation set and a test set, wherein the training set includes 2000 pairs of blurred images and real clear images, the validation set includes 103 pairs of blurred images and real clear images, and the test set includes 1111 pairs of blurred images and real clear images;
[0020] Step S402: In the data preprocessing stage, a 256*256 resolution image pair is randomly cropped from the original image pair, subjected to random horizontal and vertical flipping data enhancement processing, and finally normalized and input into the student network model. At the same time, the real clear image in the image pair is input into the converged teacher network model;
[0021] Step S403: The input blurred image is subjected to feature extraction by the encoder network, feature reconstruction by the decoder network, and finally feature fusion is performed to output the reconstructed deblurred image; at the same time, the teacher network model performs forward operation on the 256*256 real clear image to obtain intermediate feature maps of multiple clear images, and uses these intermediate feature maps to supervise the decoding feature output of the student network;
[0022] Step S404: using the L1 loss function and the frequency domain-based L1 loss function to supervise the student network output image;
[0023] Step S405: using the optimized available student network model to perform forward operation on the input test set blurred image, a restored deblurred image can be obtained.
[0024] Further, step S204 specifically includes the following steps:
[0025] The Adam optimizer is used in the training process, and the learning rate is continuously attenuated in a cosine annealing manner. When the Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM) on the validation set no longer increase, the network training stops, and the optimized and usable teacher network model is obtained.
[0026] Furthermore, step S404 specifically includes the following steps: the overall loss function L of the student network total for:
[0027] L total =L1+L fft1 +L feats
[0028] Where L1 represents the reconstruction loss, L fft1 represents the reconstruction loss based on the frequency domain, L feats Represents the intermediate feature reconstruction loss; the Adam optimizer is used in the training process, and the learning rate is continuously attenuated in a cosine annealing manner. When the peak signal-to-noise ratio and structural similarity on the validation set no longer increase, the student network stops training, and then an optimized and usable image deblurring network model is obtained.
[0029] Furthermore, in step S1, the teacher network is composed of an encoder network and a decoder network, wherein the encoder network is composed of multiple residual modules ResCAB and downsampling layers containing a channel attention mechanism. When the feature map is downsampled, the feature resolution decreases, but the convolution depth continues to deepen, and the number of extracted feature channels increases; the decoder network is composed of multiple residual modules ResCAB and upsampling layers containing a channel attention mechanism. When the feature map is upsampled, the feature resolution increases and the number of feature channels decreases; at the same time, jump connections are added between feature layers of the same resolution in the encoder-decoder network to reduce the learning difficulty and training difficulty of the encoder-decoder network; finally, the features are fused and reconstructed with the residual module ResCAB to output the reconstructed image.
[0030] Furthermore, in step S3, the student network model consists of an encoder network, a decoder network and a feature fusion network; the encoder network consists of multiple residual modules ResCAB containing channel attention and downsampling layers; the decoder network consists of improved residual modules, deformable convolution modules, etc., and there are jump connections between different scale layers of the encoder network and the decoder network; finally, the feature fusion network performs cross-scale feature fusion on the shallow features and decoding features of different scales.
[0031] Furthermore, it also includes evaluating the deblurring performance of the student network model on a blurry image test set.
[0032] Furthermore, the peak signal-to-noise ratio and structural similarity are calculated based on the deblurred image obtained by the forward operation of the converged student network and the real clear image in the blurred image dataset, and the image deblurring performance of the algorithm is evaluated by combining the network parameter amount and forward operation time.
[0033] The image deblurring algorithm based on knowledge distillation and deep neural network of the present invention has the following advantages: the present invention is based on knowledge distillation technology and deep neural network architecture, and adds a teacher network model on the basis of normal supervised training, thereby enhancing the supervision and constraints on intermediate features during network training, so as to obtain a higher quality deblurred image. Compared with the current main image deblurring algorithms, this algorithm can improve the deblurring performance of the network model while keeping the network parameters small and the forward operation time short, obtain a higher peak signal-to-noise ratio PSNR and structural similarity SSIM, and restore a clearer image. In the field of deep learning, the present invention proves that knowledge distillation can improve the performance of deep neural networks in specific fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A flowchart of the image deblurring algorithm based on knowledge distillation and deep neural network of the present invention;
[0035] Figure 2 It is a structural diagram of the teacher network model of the present invention;
[0036] Figure 3 It is a flow chart of teacher network model training and prediction of the present invention;
[0037] Figure 4 It is the overall structure diagram of the teacher network and student network model of the present invention;
[0038] Figure 5 The student network model training and prediction flow chart of the present invention;
[0039] Figure 6 The deblurred image effect comparison between the method of the present invention and the current main image deblurring algorithms is shown in FIG. DETAILED DESCRIPTION
[0040] In order to better understand the purpose, structure and function of the present invention, the following is a further detailed description of an image deblurring algorithm based on knowledge distillation and deep neural network of the present invention in conjunction with the accompanying drawings.
[0041] Example 1
[0042] See also Figure 1-Figure 6 ,This implementation provides an image deblurring algorithm based on knowledge distillation and deep neural network.
[0043] like Figure 1 , the algorithm shown in FIG. 1 specifically includes:
[0044] Step S1: construct an end-to-end deep neural network model based on the Unet structure, namely the teacher network model;
[0045] The specific structure of the teacher network model is as follows: Figure 2 As shown in the figure. The teacher network is mainly composed of an encoder network and a decoder network. The encoder network is mainly composed of multiple residual modules ResCAB and downsampling layers containing a channel attention mechanism. When the feature map is downsampled, the feature resolution decreases, but the convolution depth continues to deepen, and the number of extracted feature channels increases. The decoder network is composed of multiple residual modules ResCAB and upsampling layers containing a channel attention mechanism. When the feature map is upsampled, the feature resolution increases and the number of feature channels decreases. At the same time, jump connections are added between feature layers of the same resolution in the encoder-decoder network to reduce the learning and training difficulty of the network. Finally, the residual module ResCAB is used to fuse and reconstruct the features and output the reconstructed image.
[0046] Step S2: Obtain a fuzzy image data set, use the clear image set in the fuzzy image data set to perform supervised training on the teacher network model, and then obtain a converged teacher network model, which takes the high-definition image as input, outputs multiple intermediate features through forward operation, and obtains a restored high-definition image;
[0047] The training and prediction process of the teacher network model is as follows Figure 3 As shown, including:
[0048] Step S201: Obtain a public blurred image dataset GOPRO, divide the dataset GOPRO into a training set, a validation set and a test set, each including 2000 pairs of training image pairs, 103 pairs of validation image pairs and 1111 pairs of test image pairs; only use the real clear images of the training set to train the teacher network model.
[0049] Step S202: In the data preprocessing stage, randomly crop image blocks with a resolution of 256*256 from the original real clear image, perform data enhancement processing such as random horizontal and vertical flipping on the image blocks, and then normalize the image blocks and input them into the teacher neural network model for training;
[0050] Step S203: The input clear image is subjected to encoder network feature extraction, decoder network feature reconstruction, and finally feature fusion to obtain a reconstructed clear image.
[0051] Step S204: supervise the teacher network with L1 loss function, use Adam optimizer in the training process, and continuously decay the learning rate in a cosine annealing manner. When the PSNR and SSIM on the validation set no longer increase, the network training stops, and the optimized and available teacher network model is obtained.
[0052] Step S205: The trained teacher network model performs forward operation on the input clear image to obtain multiple decoding feature maps of different scales of the clear image, and finally outputs a restored clear image, wherein these intermediate decoding feature maps are used for subsequent supervision and training of the student network model.
[0053] Step S3: construct an end-to-end image deblurring model based on Unet structure and deformable convolution, namely, a student neural network model;
[0054] The specific structure of the student network model is as follows: Figure 4 As shown in the figure, the student network model mainly consists of an encoder network, a decoder network and a feature fusion network. The encoder network consists of multiple residual modules ResCAB containing channel attention and downsampling layers; the decoder network consists of improved residual modules, deformable convolution modules, etc. There are jump connections between the different scale layers of the encoder network and the decoder network. Finally, the feature fusion network fuses the shallow features with the decoding features of different scales across scales.
[0055] Step S4: Based on the blurred image data set in step S2, the intermediate feature output of the student network model is supervised and trained using the converged teacher network model in step S2, thereby obtaining a converged student network model. The converged student network model takes the blurred image as input and outputs a reconstructed deblurred image through forward operation.
[0056] The training and prediction process of the student network model is as follows: Figure 5 As shown, including:
[0057] Step S401: Use the GOPRO dataset divided in step S2 as the training set, validation set and test set, where the training set includes 2000 pairs of blurred images and real clear images, the validation set includes 103 pairs of blurred images and real clear images, and the test set includes 1111 pairs of blurred images and real clear images.
[0058] Step S402: In the data preprocessing stage, a 256*256 resolution image pair is randomly cropped from the original image pair, subjected to random horizontal and vertical flipping data enhancement processing, and finally normalized and input into the student network model. At the same time, the real and clear image in the image pair is input into the converged teacher network model.
[0059] Step S403: The input blurred image is subjected to feature extraction by the encoder network, feature reconstruction by the decoder network, and finally feature fusion is performed to output the reconstructed deblurred image; at the same time, the teacher network model performs forward operation on the 256*256 real clear image to obtain intermediate feature maps of multiple clear images, and uses these intermediate feature maps to supervise the decoding feature output of the student network.
[0060] Step S404: Use the L1 loss function and the L1 loss function based on the frequency domain to supervise the output image of the student network. The overall loss function L of the student network is total for:
[0061] L total =L1+L fft1 +L feats (1)
[0062] Where L1 represents the reconstruction loss, L fft1 represents the reconstruction loss based on the frequency domain, L feats Represents the intermediate feature reconstruction loss. The Adam optimizer is used in the training process to continuously decay the learning rate in a cosine annealing manner. When the Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM) on the validation set basically no longer increase, the student network stops training, and then an optimized and usable image deblurring network model is obtained.
[0063] Step S405: using the optimized fixed-parameter student network model to perform forward operation on the input test set blurred image, a restored deblurred image can be obtained.
[0064] It should be noted that the teacher network model and the student network model provided in this embodiment are not limited to the Pytorch framework, as long as the GORPO dataset can be trained and convergence is reached after several iterations (on the order of times) during the training process and the deblurred image can be reconstructed in the end.
[0065] Finally, the deblurring performance of the student network model is evaluated on the blurred image test set. More specifically, the peak signal-to-noise ratio and structural similarity are calculated based on the deblurred image obtained by the forward operation of the converged student network and the real clear image in the blurred image dataset, and the image deblurring performance of the algorithm is evaluated by combining the network parameter quantity and forward operation time. The larger the values of the peak signal-to-noise ratio and structural similarity, the better the quality of the restored image.
[0066] As shown in the following table, the deblurring performance comparison results of the method of the present invention and the current main image deblurring algorithms are shown. From the test results in the following table, the method of the present invention achieved the highest PSNR value and SSIM value on the GOPRO test set, indicating that the deblurring effect finally achieved by the method of the present invention is the best. The PSNR of the method of the present invention is still 0.56dB higher than the PNSR value of the HINet algorithm with the best performance among other algorithms in the table, indicating that the deblurring performance of the algorithm of the present invention has been greatly improved.
[0067]
[0068]
[0069] In terms of the number of network parameters, compared with the MPRNet and HINet algorithms with better deblurring effects, the method of the present invention has smaller parameters and a lighter network. In terms of the time of network forward operation, the running time of the method of the present invention is still relatively short.
[0070] like Figure 6 The figure shows a comparison of the deblurred image effects of the method of the present invention and the current main image deblurring algorithms. The first row from left to right shows the original blurred image, the deblurred images of DeepDeblur, DMPHN and MPRNet algorithms; the second row from left to right shows the deblurred images of MIMO-Unet, HINet and the method of the present invention, as well as the real clear image. From the perspective of the overall image quality and the restoration effect of local image details, it can be intuitively shown that the deblurring effect of the method of the present invention is better than that of other algorithms.
[0071] The matters not described in detail in the present invention are all known technologies to those skilled in the art.
[0072] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. An image deblurring algorithm based on knowledge distillation and deep neural network, characterized in that: The following steps are involved: Step S1: construct an end-to-end deep neural network model based on the Unet structure, namely the teacher network model; Step S2: Obtain a fuzzy image data set, use the clear image set in the fuzzy image data set to perform supervised training on the teacher network model, and then obtain a converged teacher network model, which takes the high-definition image as input, outputs multiple intermediate features through forward operation, and obtains a restored high-definition image; Step S3: construct an end-to-end image deblurring model based on Unet structure and deformable convolution, namely, the student network model; Step S4: Based on the blurred image data set in step S2, the intermediate feature output of the student network model is supervised and trained using the converged teacher network model in step S2, thereby obtaining a converged student network model. The converged student network model takes the blurred image as input and outputs a reconstructed deblurred image through forward operation.
2. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 1, characterized in that: The step S2 specifically includes the following steps: Step S201: Obtain a public blurred image dataset GOPRO, divide the dataset GOPRO into a training set, a validation set and a test set, each of which includes 2000 pairs of training image pairs, 103 pairs of validation image pairs and 1111 pairs of test image pairs; only use the real clear images of the training set to train the teacher network model; Step S202: In the data preprocessing stage, randomly crop an image block with a resolution of 256*256 from the original real clear image, perform random horizontal and vertical flipping data enhancement processing on the image block, and then normalize the image block and input it into the teacher network model for training; Step S203: The input clear image is subjected to encoder network feature extraction, decoder network feature reconstruction, and finally feature fusion to obtain a reconstructed clear image; Step S204: using L1 loss function to supervise the teacher network training; Step S205: The trained teacher network model performs forward operation on the input clear image to obtain multiple decoding feature maps of different scales of the clear image, and finally outputs a restored clear image, wherein these intermediate decoding feature maps are used for subsequent supervision and training of the student network model.
3. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 2, characterized in that: The step S4 specifically comprises the following steps: Step S401: using the data set GOPRO divided in step S2 as a training set, a validation set and a test set, wherein the training set includes 2000 pairs of blurred images and real clear images, the validation set includes 103 pairs of blurred images and real clear images, and the test set includes 1111 pairs of blurred images and real clear images; Step S402: In the data preprocessing stage, a 256*256 resolution image pair is randomly cropped from the original image pair, subjected to random horizontal and vertical flipping data enhancement processing, and finally normalized and input into the student network model. At the same time, the real clear image in the image pair is input into the converged teacher network model; Step S403: The input blurred image is subjected to feature extraction by the encoder network, feature reconstruction by the decoder network, and finally feature fusion is performed to output the reconstructed deblurred image; at the same time, the teacher network model performs forward operation on the 256*256 real clear image to obtain intermediate feature maps of multiple clear images, and uses these intermediate feature maps to supervise the decoding feature output of the student network; Step S404: using the L1 loss function and the frequency domain-based L1 loss function to supervise the student network output image; Step S405: using the available student network model after training to perform forward operation on the input test set blurred image, a restored deblurred image can be obtained.
4. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 3, characterized in that: Step S204 specifically includes the following steps: The Adam optimizer is used in the training process to continuously decay the learning rate in a cosine annealing manner. When the peak signal-to-noise ratio and structural similarity on the validation set no longer increase, the network training stops, and an optimized and usable teacher network model is obtained.
5. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 4, characterized in that: Step S404 specifically includes the following steps: the overall loss function L of the student network total for: L total =L1+L fft1 +L feats Where L1 represents the reconstruction loss, L fft1 represents the reconstruction loss based on the frequency domain, L feats Represents the intermediate feature reconstruction loss; the Adam optimizer is used in the training process, and the learning rate is continuously attenuated in a cosine annealing manner. When the peak signal-to-noise ratio and structural similarity on the validation set no longer increase, the student network stops training, and then an optimized and usable image deblurring network model is obtained.
6. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 1, characterized in that: In step S1, the teacher network is composed of an encoder network and a decoder network, wherein the encoder network is composed of multiple residual modules ResCAB and downsampling layers containing a channel attention mechanism. When the feature map is downsampled, the feature resolution decreases, but the convolution depth continues to deepen, and the number of extracted feature channels increases; the decoder network is composed of multiple residual modules ResCAB and upsampling layers containing a channel attention mechanism. When the feature map is upsampled, the feature resolution increases and the number of feature channels decreases; at the same time, jump connections are added between feature layers of the same resolution in the encoder-decoder network to reduce the learning difficulty and training difficulty of the encoder-decoder network; finally, the residual module ResCAB is used to fuse and reconstruct the features and output the reconstructed image.
7. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 1, characterized in that: In step S3, the student network model consists of an encoder network, a decoder network, and a feature fusion network; the encoder network consists of multiple residual modules ResCAB containing channel attention and a downsampling layer; The decoder network consists of an improved residual module, a deformable convolution module, etc. There are jump connections between different scale layers of the encoder network and the decoder network; Finally, the feature fusion network combines shallow features with decoding features of different scales for cross-scale feature fusion.
8. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 1, characterized in that: It also includes evaluating the deblurring performance of the student network model on a test set of blurred images.
9. The image deblurring algorithm based on knowledge distillation and deep neural network according to claim 8, characterized in that: The peak signal-to-noise ratio and structural similarity are calculated based on the deblurred image obtained by the forward operation of the converged student network and the real clear image in the blurred image dataset. The image deblurring performance of the algorithm is evaluated by combining the network parameter amount and forward operation time.
Citation Information
Patent Citations
Semi-supervised image deblurring method based on fusion attention mechanism
CN113592736A
Missile-borne image deblurring method based on generative adversarial network
CN113947589A
Auto-encoder deblurring method based on domain transformation
CN114066750A
Cited By
Image deblurring algorithm based on knowledge distillation and deep neural network
CN121903881A
