Multi-layer sub-network multi-task image inpainting method combined with spatial aggregate attention
By combining multi-layer subnets with spatial aggregation attention and feature fusion mechanisms, the efficiency and detail loss problems in image denoising, deraining, and crack removal tasks are solved, achieving efficient and realistic image restoration results, suitable for low-computing platforms and real image restoration.
Patent Information
- Application Number
- CN202410128501.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-30
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-01-30
AI Technical Summary
Existing technologies suffer from low efficiency, loss of detail, and high computational complexity in image denoising, deraining, and crack removal tasks, making it particularly difficult to achieve efficient image restoration on low-computing-power platforms.
We employ a multi-layer subnetwork approach that combines spatial aggregation attention. By using low-resolution semantic information to guide high-resolution feature learning through top, middle, and bottom subnetworks, we introduce a feature fusion mechanism and an improved encoder-decoder structure. We dynamically select multi-scale convolutions to generate complementary features and establish close spatial pixel relationships.
It achieves more efficient restoration in tasks such as rain removal, noise reduction, and crack removal, generating images with rich and realistic details. It is suitable for low-computing-power platforms, has certain generalization performance, and can restore cracks and flaws in real old photos and murals.
Smart Images

Figure CN118195960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image restoration, and in particular to a multi-layer sub-network multi-task image restoration method combined with spatial aggregate attention. Background Art
[0002] Image denoising is one of the classic image processing problems. Professionals have studied various image denoising algorithms, which are divided into two categories. The first is the traditional denoising method, such as mean filtering, which smoothes the image by calculating the average value of the surrounding neighborhood as the pixel value, but its neighborhood similarity will cause the image details to be blurred. Wavelet denoising decomposes the noisy image into different frequency sub-bands and separates the noise by threshold difference. This method can retain image details and remove noise at the same time, but the choice of threshold function directly affects the denoising effect. Improper selection will cause artifact defects in the image. The second is the denoising method based on convolutional neural network, such as DnCNN proposed by Zhang K et al.
[13] Using a unique residual mode, a pure noise image is generated through training operations such as convolution, normalization (BN), and activation (RELU). The generated noise image is then subtracted from the polluted image to obtain an ideal clean image. The mean square error (ME) loss function is introduced using residual learning to constrain the difference between the generated image and the original noise. Experiments show that this residual learning mode can improve the stability of training and the denoising effect, but it lacks flexibility and is only effective within a specific noise level range, and it is difficult to generalize to real noise images. FFDNet proposed by Zhang K et al. [2] The model abandons traditional adversarial training and designs flexible convolution kernels to process images with non-uniform noise levels. However, FFDNet can only optimize Gaussian noise and it is difficult to remove salt and pepper, Poisson and other types of noise.
[0003] Existing rain removal tasks are mainly applied to single images or continuous videos. Video-based methods can efficiently fill rain streaks through redundant information between sequence frames. In comparison, single image rain removal is more challenging. Classical methods consider this task to be a layer decomposition problem. For example, reference [3] decomposes the input image into a rain streak layer and a background layer, and uses a Gaussian mixture model to impose prior constraints on the two. The background streak recovery step (BSR) can further improve the separation quality, so it can adapt to rain streaks of different directions, sizes, and dimensions. Reference [4] developed a set of convolutional low-rank filters to separate clear background images from rain streak images. Recently, convolutional neural network-based rain removal methods have achieved good performance. Sen Deng et al. [5] et al. proposed the Detail Restoration Deraining Network (DRD-Net), which has the advantage of introducing two sub-networks with comprehensive loss functions. The two sub-networks can work together to effectively improve the common image detail loss problem in existing deraining tasks. Zhendong Wang [6]et al. proposed an improved U-shaped Transformer model (Uformer) for image deraining, which solves the problem that traditional Transformer is difficult to establish long-distance image dependencies and has the ability to fuse global and local image information. However, Uformer's self-attention operation on the entire image will increase the computational complexity and is not suitable for low-computing power platforms.
[0004] Image crack removal is a subtask of old photo restoration. Cracks are usually accompanied by fading and other defects in old photos. There is currently no independent research on image crack removal algorithms, so there is no available public crack dataset. Image filling datasets are similar to cracks, but the former mask is achieved by irregular movement of square patches. This artificially generated dataset has too large defect areas and rigid edges, which is far from the real scratches on old photos. Liu Jixin et al. [7] A generative adversarial model with reference prior and generated prior was designed, and the reference features, generated features and features to be repaired were further integrated using the spatial multi-feature transformation conditional attention module, that is, the deep structural features of the reference image were used to assist the repair process of the cracked image. The generated image has high fidelity and effectively repairs the degradation problems existing in old photos. Ziyu Wan et al. [8] A novel three-domain translation network is designed, and two variational autoencoders are set to learn the functional relationship of the latent space of the synthetic paired dataset. This relationship can be effectively extended to the restoration of real old photos.
[0005] Denoising: Shuhang Gu et al. proposed SGN [9] , using convolution operations at three resolutions to solve the image denoising problem in a self-guided manner, and it is lightweight. The FFDNet[2] model proposed by Zhang K et al. abandons traditional adversarial training and designs flexible convolution kernels to handle images with non-uniform noise levels.
[0006] Rain removal: Zhendong Wang et al. [6] An improved U-shaped Transformer model (Uformer) is proposed for image deraining, which solves the problem that traditional Transformer is difficult to establish long-distance image dependencies and has the ability to integrate global and local information of images. Yun Guo et al.
[10] A two-stage framework is proposed for image deraining. In the first stage, a low-rank matrix method based on video deraining is used to generate pseudo images. In the second stage, the Uformer framework is used to pre-train on a real rainy image dataset. Finally, fine-tuning is performed on the pseudo images to enhance the deraining effect.
[0007] Crack removal: Runsheng Xu et al. designed Pix-Fix
[11] The network consists of three subnets: coloring subnet, similarity subnet and restoration subnet, which can be used to repair and colorize old photos.
[12] An improvement was made based on the network proposed by Ziyu Wan, that is, the original residual block was replaced by a dense residual block with multi-channel attention, and finally combined with a face enhancement network to improve the restoration effect.
[0008] Image restoration is an image processing technique that restores low-level damaged images to their original state. It is often used in military, medical, archaeological, autonomous driving and other fields. In reality, images are often subject to degradation such as noise, distortion, and rain marks during the acquisition process due to equipment limitations and the influence of bad weather. In the early days, professional technicians usually relied on experience to restore damaged images. However, this manual method is not only inefficient but also difficult. Recently, convolutional neural network
[13] (CNN) models have made significant breakthroughs in image processing tasks. This type of method usually achieves image restoration or image enhancement by learning the mapping relationship between image domains in a targeted manner. CNN models usually adopt the following two architectures: (1) encoder-decoder and (2) high-resolution single-scale. The encoder-decoder [14-18] model maps the input image to a low-resolution representation and then reversely maps the feature representation to the original size. Although this structure performs well in low-resolution semantic information, repeatedly changing the image size is not conducive to stabilizing spatial details. High-resolution single-scale models [19-21] do not use downsampling operations but can provide reliable texture details. However, their limited receptive fields make these networks inefficient in encoding semantics. The above two structures are indispensable in image restoration tasks. Simply connecting the encoder-decoder in series or in parallel with the high-resolution single-scale will produce suboptimal results. Therefore, it is crucial to find a combination that can give full play to the advantages of the two models.
[0009] [1] Zhang K., Zuo, W., Chen, Y., Meng, D., & Zhang, L. (2017b). Beyond a Gaussiandenoiser: Residual learning of deep CNN for image denoising. IEEE Transactionson Image Processing, 26(7), 3142–3155. https: / / doi.org / 10.1109 / tip.2017.2662206
[0010] [2] Zhang K., Zuo, W., & Zhang, L. (2018). FFDNET: Toward a fast and Flexiblesolution for CNN-Based image denoising. IEEE Transactions on Image Processing, 27(9), 4608–4622. https: / / doi.org / 10.1109 / tip.2018.2839891
[0011] [3]Li,Y.,Tan,RT,&Guo,X.(2016).Rain Streak Removal Using LayerPriors.CVPR. https: / / doi.org / 10.1109 / cvpr.2016.299
[0012] [4]Hu,X.,Fu,C.,&Zhu,L.(2019).Depth-Attentional Features for Single-Image Rain Removal.CVPR. https: / / doi.org / 10.1109 / cvpr.2019.00821
[0013] [5]Deng, S., Wei, M., Wang, J., Liang, L., Xie, H., & Wang, M. (2019b). DRD-Net: Detail-recovery image deraining via context Aggregation networks. arXiv (Cornell University). http: / / export.arxiv.org / pdf / 1908.10267
[0014] [6]Wang, Z., Cun, https: / / doi.org / 10.1109 / cvpr52688.2022.01716
[0015] [7] Liu Jixin, Chen Rui, An Shipeng. Old photo restoration by integrating reference prior and generative prior[J]. Journal of Image and Graphics, 2022, 27(05):1657-1668.
[0016] [8]Wan,Z.,Zhang,B.,&Chen,D.(2020).Bringing Old Photos Back toLife.CVPR. https: / / doi.org / 10.1109 / cvpr42600.2020.00282
[0017] [9]Gu,S.,Li,Y.,&Van Gool,L.(2019).Self-Guided Network for Fast ImageDenoising.ICCV. https: / / doi.org / 10.1109 / iccv.2019.00260
[0018]
[10] Yun Guo,Xueyao Xiao,Xiaoxiong Wang,et al.A Two-Stage Real ImageDeraining Method for GT-RAIN Challenge CVPR 2023Workshop UG2+Track 3.IEEE / CVFConferenceonComputer Vision and Pattern Recognition(CVPR),2023
[0019]
[11] Xu RS, Tu ZZ, Du YQ, et al. Pik-Fix: Restoring and Colorizing OldPhoto. ArXiv: Computer Vision and Pattern Recognition, 2022
[0020]
[12] Sun Longjian. Research on old photo restoration algorithm based on deep learning. Central China Normal University, 2023.
[0021]
[13] LeCun, Y., Bottou, L., Bengio, Y., & Haffner, P. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11), 2278–2324. https: / / doi.org / 10.1109 / 5.726791
[0022]
[14] Quan W, Zhang R, Zhang Y, et al. Image Inpainting With Local and Global Refinement. IEEE Transactions on Image Processing, 2022, 31: 2405–2420
[0023]
[15] Zeng Y,Lin Z,Lu H C.CR-Fill:Generative Image Inpainting withAuxiliary Contexutal Reconstruction.ArXiv:Computer VisionandPatternRecognition,2020
[0024]
[16] Zheng C,Cham T J,Cai J,et al.Bridging Global Context Interactionsfor High-Fidelity Image Completion.IEEE / CVF ConferenceonComputer Vision andPattern Recognition(CVPR),2022
[0025]
[17] Xinqi Lin,Jingwen He,Ziyan Chen,et al.DiffBIR:Towards Blind ImageRestoration with Generative Diffusion Prior.Computer Science:Computer Visionand Pattern Recognition.2023
[0026]
[18] Liangyu Chen,Xiaojie Chu,Xiangyu Zhang,et al.NAFNet:NonlinearActivation Free Network for Image Restoration,European Conference on ComputerVision,2022
[0027]
[19] Wang J,Sun K,Cheng T,et al.Deep High-Resolution RepresentationLearning for Visual Recognition.IEEE Transactions on PatternAnalysis andMachine Intelligence,2021,43(10):3349–3364
[0028]
[20] Yuanhao Cai, Hao Bian, Jing Lin, et al. Retinexformer: One-stage Retinex-based Transformer for Low-light Image Enhancement.arXiv:2303.06705.2023
[0029]
[21] Zhang Y, Tian Y, Kong Y, et al.Residual Dense Network for ImageRestoration.IEEE Transactions on Pattern Analysis and MachineIntelligence,2021,43(7):2480–2495 Summary of the invention
[0030] To solve the problems existing in the prior art, the object of the present invention is to provide a multi-layer sub-network multi-task image restoration method combined with spatial aggregated attention.
[0031] To achieve the above purpose, the technical solution adopted by the present invention is: a multi-layer sub-network multi-task image restoration method combined with spatial aggregate attention, comprising the following steps:
[0032] Step 1. Select an image with rain marks, noise or cracks;
[0033] Step 2: The input image passes through the top subnet, the middle subnet, and the bottom subnet at the same time, and uses low-resolution semantic information to guide high-resolution feature learning layer by layer in a self-guided manner to achieve multi-task image restoration;
[0034] Step 3: The feature fusion mechanism FFM and the improved encoder-decoder structure are connected to the multi-stage network to meet the needs of enriching semantic information and improving spatial accuracy;
[0035] Step 4: Set up a spatial aggregation attention module SAAM at each stage to dynamically select a set of complementary features generated by multi-scale convolutions and establish tight spatial pixel connections for filling unknown areas.
[0036] As a further improvement of the present invention, in step 2, the low spatial resolution of the top-level subnet is used to generate a strong semantic feature representation, separate the degraded information from the real signal, and fuse the acquired real information into the next convolutional structure; the middle-level subnet inherits the guided features from the top-level subnet, uses the shuffle×2 operation to increase the top-level output image resolution, and then connects the obtained image to the early stage of the middle-level subnet; the downsampling operation is canceled in the bottom-level subnet and is only performed on the original resolution image.
[0037] As a further improvement of the present invention, the underlying subnet adopts 6 residual modules based on the ResNet network to further process the joint features. The module includes a convolution layer, a pooling layer and an activation layer. Finally, a residual connection is used to add the input features to the output of the convolution layer to avoid information loss and deformation.
[0038] As a further improvement of the present invention, in step 3, the improved encoder-decoder structure adopts an end-to-end training method, the improved encoder-decoder structure is applied to the multi-layer subnet architecture design, and 4 dilated convolution residual modules are added at the bottom to increase the receptive field and nonlinear representation ability of the network model; and according to the scale of different stages, the number of encoding layers of the improved encoder-decoder structure is adjusted to 2 layers in the first stage, 3 layers in the second stage, and 4 layers in the third stage, the pooling layer is modified to a downsampling convolution layer to make full use of each pixel to accurately extract features, and the transposed convolution is set to bilinear upsampling to avoid checkerboard artifacts.
[0039] As a further improvement of the present invention, in step 3, the feature fusion mechanism is introduced between the two encoders-decoders and between the encoder-decoder and the underlying subnetwork; before the cross-stage features are aggregated, they are refined using a 1×1 convolution kernel.
[0040] As a further improvement of the present invention, in step 4, the spatial aggregation attention module is used to simulate the hidden layer of the channel attention, using the same reduction ratio to reduce the feature map channels; three different scale convolution operations are performed in parallel to achieve different levels of spatial information aggregation, and then a useful feature set is dynamically selected from each branch through an adaptive weight adjustment module, ultimately achieving interaction and complementation between the three features.
[0041] The beneficial effects of the present invention are:
[0042] The evaluation results of all indicators of the present invention are better than those of the control group in tasks such as rain removal, denoising, and crack removal. The present invention has better complex degradation repair capabilities, richer repair details, and more realistic images. In addition, the present invention also shows good performance in repairing real old photos and real mural images. It can remove obvious crack defects in images and has the ability to repair salt and pepper noise, and has certain generalization performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a schematic diagram of the overall framework of an embodiment of the present invention;
[0044] Figure 2 Schematic diagram of the internal structure of the feature fusion mechanism (FFM, Feature Fusion Module) in the repair network in an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the internal structure of a codec in a repair network according to an embodiment of the present invention;
[0046] Figure 4 Schematic diagram of the internal structure of the spatial aggregation attention mechanism (SAAM) in the repair network in an embodiment of the present invention;
[0047] Figure 5 Schematic diagram of the internal structure of the weight adjustment module (AWAM, Adaptive Weight Adjustment Module) in the repair network in an embodiment of the present invention;
[0048] Figure 6 Schematic diagram of experimental results of SIDD data set in an embodiment of the present invention;
[0049] Figure 7 Schematic diagram of experimental results of the Rain200H data set in an embodiment of the present invention;
[0050] Figure 8 It is a schematic diagram of the experimental results of combining the crack dataset with the CelebA face dataset in an embodiment of the present invention;
[0051] Fig. 9 Schematic diagram of salt and pepper noise removal results including the CelebA face dataset and the Landscape dataset in an embodiment of the present invention;
[0052] Fig.10 Schematic diagram of experimental results of a thangka dataset in an embodiment of the present invention;
[0053] Fig.11 This is a schematic diagram of the visualization result of the damaged mural restoration in an embodiment of the present invention;
[0054] Fig.12 This is a schematic diagram of the visualization comparison results of the SIDD data set in an embodiment of the present invention;
[0055] Fig.13 A schematic diagram showing a visualization comparison of the Rain200L validation set results in an embodiment of the present invention;
[0056] Fig.14 This is a schematic diagram of the visualization result of the Landscape dataset denoising in an embodiment of the present invention;
[0057] Fig.15 This is a schematic diagram of the visualization result of crack removal of a thangka dataset in an embodiment of the present invention;
[0058] Fig.16 Schematic diagram of restoration results of a real old photo in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0060] Example
[0061] like Figure 1 As shown, a multi-layer sub-network multi-task image restoration method combined with spatial aggregation attention includes:
[0062] Step 1: Select an image with rain marks or noise or cracks;
[0063] Step 2: The input image passes through the top subnet, middle subnet, and bottom subnet at the same time, and uses low-resolution semantic information to guide high-resolution feature learning layer by layer in a self-guided manner to achieve multi-task image restoration;
[0064] Step 3: The proposed feature fusion mechanism (FFM) and the improved encoder-decoder structure are then connected to the multi-stage network to meet the needs of enriching semantic information and improving spatial accuracy.
[0065] Step 4: A spatial aggregation attention module (SAAM) is set up at each stage, which can dynamically select complementary feature sets generated by multi-scale convolutions, establish tight spatial pixel connections to efficiently fill unknown areas, and generate better results.
[0066] Top Subnet: The core idea of this network is to use the semantics of the top subnet to progressively guide the recovery of high-scale convolutional layers. The low spatial resolution of the top subnet can not only generate strong semantic feature representations, but also separate the degraded information from the real signal, and then fuse the acquired real information into the next convolutional structure.
[0067] Middle subnet: The structure of the middle subnet is similar to that of the top subnet, including residual, encoder-decoder, and SAAM modules. The difference is that the middle subnet needs to inherit the guided features from the top subnet. This embodiment uses the shuffle×2 operation to increase the resolution of the top-level output image, and then connects the obtained image to the early stage of the middle subnet. This feature introduction method helps to achieve a trade-off between accuracy and speed for restoration tasks such as denoising.
[0068] Bottom subnet: The image restoration process needs to maintain spatially accurate high resolution. The existing single-scale channel model is reliable in generating images with rich details, but the inherent limitations of the architectural design make it difficult for this method to have excellent semantic understanding capabilities at the same time. To ensure end-to-end detail stability, this embodiment cancels the downsampling operation in the bottom subnet (BottomSubnet) of the model and only performs it on the original resolution image. Specifically, this embodiment uses 6 residual modules (RSM) based on the ResNet network to further process the joint features. The module includes convolutional layers, pooling layers, and activation layers. Finally, the residual connection is used to add the input features to the output of the convolutional layer to avoid information loss and deformation.
[0069] Codec module: Its back structure is as follows Figure 3 As described, the U-net structure adopts an end-to-end training method, has strong scalability, and is suitable for a variety of image conversion tasks. Therefore, this embodiment applies U-net to the current multi-layer subnet architecture design, and adds 4 dilated convolution residual modules at its bottom to increase the receptive field and nonlinear representation ability of the network model. In the traditional U-net architecture, the pooling layer discards some pixel values to reduce the amount of calculation, but this will cause information loss and limited decoder capabilities, and the image details cannot be fully restored. In this embodiment, according to the scale of different stages, the number of U-net encoding layers is adjusted to 2 layers in the first stage, 3 layers in the second stage, and 4 layers in the third stage. The pooling layer is modified to a downsampling convolution layer to make full use of each pixel to accurately extract their features, and the transposed convolution is changed to bilinear upsampling to avoid chessboard artifacts.
[0070] Spatial Aggregate Attention Mechanism (SAAM): Figure 4 As shown in , SAAM simulates the hidden layer of channel attention and uses the same reduction ratio to reduce the feature map channels. This setting can compress the input features into another dimensional space to show more abstract features, so as to better perform linear division and extract more valuable information. From the perspective of the local module, this embodiment removes the original maximum pooling operation to further retain the feature map. In addition, in order to further focus on spatial information, three different scale convolution operations are parallelized here to achieve different levels of spatial information aggregation, and then through Figure 5 The Adaptive Weight Adjustment Module (AWAM) shown in the figure dynamically selects useful feature sets from each branch, and finally realizes the interaction and complementation between the three features. Therefore, the spatial aggregation attention mechanism can enhance the network's attention to local details and is more suitable for image restoration tasks such as rain removal, denoising and crack removal.
[0071] Feature Fusion Mechanism (FFM): Figure 2 As shown, this embodiment introduces a feature fusion mechanism (FFM) between the two encoders and decoders and between the encoder and decoder and the underlying subnet. Figure 2 In the figure, the left side shows the connection between the encoder and decoder, and the right side shows the connection between the bottom layer and the encoder and decoder. The model is based on the transmission of feature maps of the same scale. Before the cross-stage features are aggregated, they are refined using a 1×1 convolution kernel. This transmission mechanism is not only conducive to the stable transmission of cross-layer information, but also provides deeper semantic guidance for the next stage encoder-decoder structure based on the self-guided structure. Finally, the introduction of FFM increases the multi-selectivity of information flow, thereby accelerating the optimization process of the network.
[0072] The present embodiment is further described below:
[0073] First, if Figure 6 and Figure 7 As shown, this embodiment verifies the effectiveness of the model in denoising and rain removal on the SIDD and Rain200H public datasets;
[0074] Second, this embodiment constructs a dataset of 6000 crack images for verifying the image crack removal task. These crack masks can be used in combination with any public image dataset and are highly adaptable, such as Figure 8 and Fig.10 As shown, this embodiment combines the crack image with the thangka dataset and the CelebA face dataset respectively;
[0075] Third, the target of existing denoising methods is usually Gaussian noise, and few methods focus on the removal of salt and pepper noise. However, this embodiment can achieve the removal of salt and pepper noise. Fig. 9 As shown in the figure, salt and pepper noise is added to the Landscape dataset and put into training to verify the ability of the proposed method to remove salt and pepper noise;
[0076] Finally, if Fig.10 As shown in the figure, the universality of the proposed method is verified by testing the national intangible cultural heritage thangka dataset; Fig.11This is a schematic diagram of the visualization results of damaged mural restoration. From top to bottom, it shows the real damaged mural and the image generated by SAAMNet.
[0077] Fig.12 This is the experimental comparison result of SAAMNet and three classic models: SGN, DnCNN, and CBDNet. Fig.12 In the figure, from left to right are input image, reference image, SGN, DnCNN, CBDNet, and SAAMNet (algorithm of this embodiment).
[0078] Fig.13 This is the experimental comparison result of SAAMNet with three classic models: U-net, EffcientDeRain, and PReNet. Fig.13 In the figure, from left to right are rain-marked images, reference images, U-net, Effcient DeRain, PReNet, and SAAMNet.
[0079] like Fig.14 As shown, in order to verify the ability of this algorithm to remove salt and pepper noise, this embodiment adds salt and pepper noise to the color images in the Landscape dataset for training. Fig.14 In the figure, from left to right are the color image processed with salt and pepper noise, the reference image, and the generated image.
[0080] Fig.15 This is the image decracking result of SAAMNet on the Tangka dataset. Fig.15 In the figure, from top to bottom are the thangka image with cracks, the reference image, and the SAAMNet generated image.
[0081] like Fig.16 As shown, in order to verify the generalization ability of the algorithm on real old film images, this embodiment fades 6000 images of the CelebA face dataset, adds crack masks to the model for training, and then applies the obtained weights to real old movie images; Fig.16 In the figure, from left to right are the simulated degraded images used for training, the reference images, the simulated degraded images restored by SAAMNet, the real old photo images, and the old photo images restored by SAAMNet.
[0082] The experiments use peak signal-to-noise ratio (PSNR), structural similarity (SSIM) and the latest learned perceptual image patch similarity (LPIPS) evaluation criteria to evaluate image quality.
[0083] Below are the quantitative results on the Image Denoising Dataset (SIDD):
[0084] Table 1 Quantitative evaluation of SIDD validation set
[0085]
[0086] The following are the quantitative results of the image deraining dataset (Rain200L):
[0087] Table 2 Quantitative evaluation of Rain200L validation set
[0088]
[0089] Since there is no dedicated algorithm for image crack removal, only the results of SAAMNet in crack removal are shown, and the SSIM, PSNR, and LPIPS metric scores are listed in Table 3 to evaluate the quality of the generated images. Among them, the PSNR value can reach up to 38.01dB, proving that this algorithm is sufficient to ensure the quality of image restoration.
[0090] Table 3 Quantitative evaluation of image descrambling validation set
[0091]
[0092] The above-mentioned embodiments only express the specific implementation of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A multi-layer sub-network multi-task image restoration method combined with spatial aggregate attention, characterized in that: The following steps are involved: Step 1. Select an image with rain marks, noise or cracks; Step 2: The input image passes through the top subnet, the middle subnet, and the bottom subnet at the same time, and uses the low-resolution semantic information to guide the high-resolution feature learning layer by layer in a downsampling self-guided manner to achieve multi-task image restoration; Step 3: The feature fusion mechanism FFM and the improved encoder-decoder structure are connected with the multi-layer subnet architecture to meet the needs of enriching semantic information and improving spatial accuracy; In step 3, the improved encoder-decoder structure adopts an end-to-end training method, applies the improved encoder-decoder structure to the multi-layer subnet architecture design, and adds 4 dilated convolution residual modules at the bottom to increase the receptive field and nonlinear representation ability of the network model; and according to different branch scales, the number of encoding layers of the improved encoder-decoder structure is adjusted to 2 layers for the first branch, 3 layers for the second branch, and 4 layers for the third branch, the pooling layer is modified to a downsampling convolution layer to make full use of each pixel to accurately extract features, and the transposed convolution is set to bilinear upsampling to avoid checkerboard artifacts; The fourth branch does not adopt the encoder-decoder structure; Applying the improved encoder-decoder structure to the multi-layer subnet architecture design specifically includes: The first branch of the multi-layer subnet architecture is at the top layer of the four branches, called the top subnet; the second and third branches are in the middle two layers of the four branches, called the middle subnet; the fourth branch is at the bottom layer of the four branches, called the bottom subnet; the top subnet semantics are used to progressively guide the recovery of high-scale convolutional layers; the middle subnet uses the shuffle×2 operation to increase the resolution of the top output image, and then connects the obtained image to the early stage of the middle subnet; the downsampling operation is canceled in the bottom subnet and is only performed on the original resolution image; Step 4: Set the spatial aggregation attention module SAAM in the first three branches to dynamically select the complementary feature sets generated by multi-scale convolutions and establish tight spatial pixel connections for filling unknown areas.
2. The multi-layer sub-network multi-task image restoration method combined with spatial aggregate attention according to claim 1 is characterized in that: In step 2, the low spatial resolution of the top-level subnetwork is used to generate strong semantic feature representations, separate the degraded information from the real signal, and fuse the acquired real information into the next convolutional structure; the middle-level subnetwork inherits the guided features from the top-level subnetwork, uses the shuffle×2 operation to increase the top-level output image resolution, and then connects the obtained image to the early stage of the middle-level subnetwork; in the bottom-level subnetwork, a high-resolution single-scale structure is set to replace the commonly used downsampling operation, that is, it is only performed on the original resolution image.
3. The multi-layer sub-network multi-task image restoration method combined with spatial aggregate attention according to claim 2 is characterized in that: The bottom subnet uses 6 residual modules based on the ResNet network to further process the joint features. The modules include convolutional layers, pooling layers and activation layers. Finally, residual connections are used to add the input features to the output of the convolutional layer to avoid information loss and deformation.
4. The multi-layer sub-network multi-task image restoration method combined with spatial aggregate attention according to claim 1 is characterized in that: In step 3, the feature fusion mechanism is introduced between the two encoders and decoders and between the encoder and decoder and the underlying subnetwork; Before aggregating the cross-stage features, they are refined using a 1×1 convolution kernel.
5. The multi-layer sub-network multi-task image restoration method combined with spatial aggregate attention according to claim 1 is characterized in that: In step 4, the spatial aggregation attention module is used to simulate the hidden layer of channel attention, using the same reduction ratio to reduce the feature map channels; three different scale convolution operations are performed in parallel to achieve different levels of spatial information aggregation, and then the adaptive weight adjustment module is used to dynamically select useful feature sets from each branch, ultimately achieving interaction and complementation between the three features.
