Image super-resolution reconstruction method based on hybrid attention and two-layer supervision

By employing a hybrid attention and dual-layer supervision method for image super-resolution reconstruction, the problem of insufficient utilization of reference image information in existing technologies is solved, achieving high-quality image reconstruction results and improving the visual perception quality of image super-resolution.

CN114897694BActive Publication Date: 2024-09-24NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210503215.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2024-09-24
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

Existing RefSR methods do not fully utilize the high-frequency information of the reference image, resulting in the reconstruction effect being affected by noise, making it difficult to recover high-quality, high-resolution images.

Method used

A super-resolution image reconstruction method based on hybrid attention and dual-layer supervision is adopted. By optimizing feature matching through multi-scale feature extraction, transformer attention and channel attention, and updating network parameters by combining dual-layer supervision signals, high-quality image reconstruction is achieved.

Benefits of technology

It improves the effect and visual experience of image super-resolution reconstruction, makes full use of reference image information, reduces the impact of noise, and restores more realistic image textures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The present invention discloses an image super-resolution reconstruction method based on hybrid attention and double-layer supervision, including obtaining a high-resolution label image and a reference image and downsampling them to construct a data set; performing multi-scale feature extraction on the image of the data set; obtaining corresponding features from the reference image features using transformer attention; adaptively optimizing the extracted corresponding features using channel attention to obtain migration features; fusing the migration features with the low-resolution image features through a decoder network to achieve high-quality image reconstruction, and using a double-layer supervision signal to update network parameters to minimize losses. The present invention can improve the reconstruction effect and visual experience of super-resolution reconstruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing and computer vision, and specifically relates to an image super-resolution reconstruction method based on hybrid attention and double-layer supervision. Background Art

[0002] Image super-resolution (SR) is a fundamental computer vision task that aims to recover natural high-frequency details from a given low-resolution image. Image super-resolution is widely used in some fields with high requirements on image quality, such as medical imaging, satellite survey, surveillance, security, etc., in addition to which it also helps to improve other computer vision tasks. Generally, the research on image super-resolution is divided into two types: single image super-resolution (SISR) and reference-based image super-resolution (RefSR). Among them, SISR mainly restores LR images by obtaining the LR-HR mapping relationship through the LR-HR image training model. However, due to the inherent information loss between LR and HR images, these classic single super-resolution methods often find it difficult to overcome the defects of the restored images having large visual artifacts and blurring effects.

[0003] Recently, RefSR has achieved some success in the SR field. It introduces an additional high-resolution image as a reference image, and transmits the texture features of the reference image to provide finer details for the LR image to achieve a good reconstruction effect. The traditional RefSR method needs to transfer features based on the premise that the reference image and the low-resolution image have similar content or good alignment. Otherwise, when the reference image is very different from the low-resolution image, the effect of super-resolution restoration will be seriously reduced.

[0004] Existing RefSR methods can rely on implicit correspondence matching to discover the deep feature correspondence between the LR image and Ref to transfer more accurate HR texture from the reference image (Ref) to compensate for the information loss in the input image. However, the difference between the low-resolution input image and the high-resolution reference image still affects the effective use of the Ref image. Some noise information in the transferred features will have a bad effect in the subsequent fusion with the low-resolution image features, and affect the convergence of the network and the final effect. Therefore, it is an important challenge to make full use of the information in the Ref image to improve the SR performance. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide an image super-resolution reconstruction method based on hybrid attention and double-layer supervision in view of the shortcomings of the above-mentioned prior art, which can solve the problem that the prior art does not fully utilize the high-frequency information of the Ref image.

[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:

[0007] An image super-resolution reconstruction method based on hybrid attention and double-layer supervision is characterized by including

[0008] Step 1: Get the high-resolution label image HR and the reference image Ref and downsample them to obtain the corresponding low-resolution images LR and Ref↓. Perform data enhancement on HR, Ref, LR and Ref↓ to construct a dataset.

[0009] Step 2: The multi-scale feature extraction module extracts multi-scale features from the images of the dataset through the encoder network. Both HR and Ref obtain three different scaling features, which are denoted as F HR and F Ref , LR and Ref↓ get F LR and F Ref↓ ;

[0010] Step 3: The feature selection module uses transformer attention to select features from F based on the correlation between LR and Ref. Ref Get the corresponding feature F;

[0011] Step 4: The feature adaptation module uses channel attention to adaptively optimize F and obtain the optimized migration features.

[0012] Step 5: Encoding reconstruction module With F LR The fusion feature F is obtained by fusion of the decoder network fusion , the fused feature F fusion The compensation is added to the LR to obtain the final super-resolution image SR, achieving high-quality image reconstruction, and a double-layer supervision signal is used to update the network parameters to minimize the loss.

[0013] To optimize the above technical solutions, the specific measures taken also include:

[0014] In step 1 above, HR, Ref, LR and Ref↓ are horizontally or vertically flipped and randomly rotated by 90°, 180° and 270° to enhance the data.

[0015] The encoder network described in step 2 above includes three building blocks to extract features at three resolution scales of 1×, 2×, and 4×;

[0016] Multi-scale feature extraction is performed on HR and Ref through the three building blocks of the encoder network, and three corresponding different scaling features are obtained;

[0017] The first building block of the encoder network extracts features from LR and Ref↓ to obtain feature F LR and F Ref↓ .

[0018] The feature selection module described in step 3 above first embeds the correlation between LR and Ref, and then uses the correlation to extract the feature from F Ref Extract the information used to compensate for low-resolution image restoration as the corresponding features to be migrated on Ref. The specific process is as follows:

[0019] Step 3-1: Estimate LR feature F LR and Ref↓ feature F Ref↓ The similarity between them is used to embed the correlation between LR and Ref images:

[0020] F LR and F Ref↓ Expand into 3×3 small blocks and record them as q i (i∈[1,H LR ×W LR ]) and k j (j∈[1,H Ref ×W Ref ]), and calculate the correlation between small blocks by normalizing the inner product:

[0021]

[0022] r i,j represents the correlation between the i-th position in LR and the j-th position in Ref;

[0023] Step 3-2: After obtaining the correlation, further calculation is performed to obtain the hard attention map H and the soft attention map S:

[0024] First, a hard attention map H is calculated, where the i-th element h i (i∈[1,H LR ×W LR ]) is determined by the correlation r i,j Calculated:

[0025]

[0026] Among them, h i The value of can be regarded as an index, indicating the position in the Ref image that is most relevant to the i-th position in the LR image;

[0027] Then use the obtained hard attention map H to Ref The expanded patch V performs index selection operation:

[0028]

[0029] t i represents the value of T in the i-th image block, which is obtained from F Ref No.h i Position selected;

[0030] Finally, all t i (i∈[1,H LR ×W LR ]) Aggregate to obtain the HR feature T after feature matching;

[0031] In order to avoid that the information of each position in T is treated equally, we further use q i and k j The correlation r i,j , apply different attention weights to different positions of feature T, specifically:

[0032] First, a soft attention map S is calculated, where the i-th element s i (i∈[1,H LR ×W LR ]) Through the correlation r i,j The calculation results are:

[0033]

[0034] where s i Represents the attention weight of feature T at the i-th position;

[0035] Step 3-3: Apply the obtained soft attention map S to the feature T to obtain the feature F for migration:

[0036] F=T⊙S

[0037] Among them, the operator ⊙ represents the element-by-element multiplication between feature maps, and the feature F represents the corresponding feature to be migrated on Ref.

[0038] The feature adaptation module described in step 4 above uses the residual structure to apply channel attention to the corresponding features, adaptively applies different attention to each channel of the feature, and obtains the optimized migration feature

[0039] The channel attention adopts two channel descriptors, average pooling and maximum pooling, to aggregate the spatial information of feature maps, and uses a shared network to map the channel descriptors into channel weight values ​​in a way of first reducing the dimension and then increasing the dimension.

[0040] In step 4 above, adaptively applying different attention to each channel of the feature means adaptively scaling the channel features by learning the interdependence between channels. Specifically:

[0041] For a feature map x of size C×H×W, we first aggregate the spatial information of the feature map using average pooling and maximum pooling operations to generate a channel descriptor z representing each channel avg and z max , where the cth element is calculated from all elements of the channel:

[0042]

[0043]

[0044] Among them, x c (i, j) is the value of the c-th channel feature at (i, j), H AP (·) is the global average pooling function, H MP (·) is the global maximum pooling function;

[0045] Then the channel descriptor z avg and z max Adaptively learn weights via a shared network:

[0046] s=σ(MLP(z avg +z max ))=σ(W U δ(W D (z avg +z max )))

[0047] Among them, σ(·) and δ(·) represent the Sigmoid function and ReLU function respectively;

[0048] W D is the weight of the first layer of the activation network, W U are the weights that activate the second layer of the network;

[0049] The channel descriptor reduces the number of channels by a ratio of r, is activated by ReLU, and then increases by a ratio of r by the channel upscaling layer. Finally, the channel weights of each layer are mapped to between 0 and 1 through the Sigmoid function.

[0050] The obtained channel weights are further applied to the input feature map x to achieve different attention for each channel: y c =s c ·x c

[0051] Among them, s c is the weight of the cth channel, x c is the c-th channel feature;

[0052] Through the above operation, the features obtained in step 4 are filtered in the channel dimension, and then the migration features after optimization are obtained.

[0053] The above step 5 double-layer supervision signal updates the network parameters:

[0054] At the intermediate feature layer, an additional triple supervision loss is adopted To minimize the distance between the features of the HR image and the fusion features:

[0055]

[0056] Among them I HR represents the real image, represents the nth layer of the encoder, represents the features of HR image, F fusion Represents LR features and migration features The fusion characteristics of

[0057] At the final image layer, three types of losses, namely reconstruction loss, perceptual loss and generative adversarial loss, are used to supervise and limit the distance between HR and the final super-resolution reconstructed image SR in pixel space and feature space, in the hope of restoring more realistic textures.

[0058] Finally, the supervisory signals at the intermediate feature layer and the image layer are used to learn more powerful features.

[0059] The present invention has the following beneficial effects:

[0060] The present invention obtains high-resolution label images and reference images and downsamples them to construct a data set; performs multi-scale feature extraction on the images in the data set; uses transformer attention to obtain corresponding features from reference image features; uses channel attention to adaptively optimize the extracted corresponding features to obtain migration features; fuses the migration features with low-resolution image features through a decoder network to achieve high-quality image reconstruction, and uses a double-layer supervisory signal to update network parameters to minimize losses. It can improve the reconstruction effect and visual experience of super-resolution reconstruction.

[0061] 1. The present invention combines transformer attention with channel attention to make better use of the information of the reference image:

[0062] First, high-quality correspondence matching is achieved through the first stage of attention, and high-resolution texture features for transmission are extracted from the reference image. Then, the obtained texture features are further strengthened through the second stage of attention to learn important features and suppress the propagation of noise information. This coarse-to-fine feature selection mode improves the utilization of reference image feature information.

[0063] 2. The present invention introduces a double-layer supervision strategy to quantify the similarity between the deep features and fusion features of the HR image at different scales, and applies it to the evaluation function and loss function to stimulate the network to learn more accurate feature representation, thereby restoring more realistic image texture. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 It is the overall scheme principle diagram of the present invention;

[0065] Figure 2 A schematic diagram of the structure of hybrid attention according to an embodiment of the present invention;

[0066] Figure 3 A comparison chart of the effects of the present invention and other methods on super-resolution reconstruction;

[0067] Figure 4 It is a parameter comparison diagram of the present invention and other methods;

[0068] Figure 5 User evaluation diagrams of the present invention and other methods;

[0069] Figure 6 The figure is a flowchart of the method of the present invention. DETAILED DESCRIPTION

[0070] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings.

[0071] This paper proposes an image super-resolution reconstruction method based on hybrid attention and double-layer supervision, which transfers the high-frequency information on the reference image to the LR image to achieve high-quality image reconstruction. Figure 1 As shown in the figure, it is mainly implemented through three parts: multi-scale feature extraction module, hybrid attention module and encoding reconstruction module.

[0072] See also Figure 6 Specifically, the method of the present invention comprises:

[0073] Step 1: Collect high-resolution label images HR and reference images Ref and downsample them to obtain the corresponding low-resolution images LR and Ref↓. Perform data enhancement on HR, Ref, LR and Ref↓ to construct a dataset.

[0074] HR, LR, Ref, Ref↓, SR of the present invention are respectively a high-resolution image, a low-resolution image, a high-resolution reference image, a 4×bicubic down-sampling reference image, and a super-resolution reconstructed image finally generated;

[0075] Different from previous methods, the present invention also uses the information of HR images to supervise the model learning of the present invention;

[0076] Step 2: The multi-scale feature extraction module extracts multi-scale features from the images of the dataset through the encoder network. Both HR and Ref obtain three different scaling features, which are denoted as F HR and F Ref , LR and Ref↓ get F LR and F Ref↓ ;

[0077] Multi-scale feature extraction is achieved through an encoder network, which contains three building blocks. The image passes through the three building blocks in sequence to extract features of three different scales. HR and Ref extract features of three scales, while LR and Ref↓ only extract features through the first building block.

[0078] In the embodiment, the encoder network includes three building blocks, which can extract features of three resolution scales (1×, 2×, 4×). HR and Ref obtain three different scaled features through the encoder network, while LR and Ref↓ only pass through the first block of the encoder network to generate feature F LR and F Ref↓ .

[0079] The hybrid attention module consists of two parts: one is a feature selection module that implements spatial position attention, and the other is a feature adaptation module that implements channel attention.

[0080] Step 3: The feature selection module uses transformer attention to obtain corresponding features from the Ref image features;

[0081] The feature selection module can establish F Ref↓ and F LR The corresponding match is made in F Ref Searches for available texture features.

[0082] Step 4: The feature adaptation module uses channel attention to perform adaptive optimization processing on the corresponding features;

[0083] The feature adaptation module can further optimize the features searched in the previous part to obtain the final migration features

[0084] Step 5: The encoding and reconstruction module fuses the migration features with the LR image features through the decoder network to achieve high-quality image reconstruction, and uses a two-layer supervision signal to update the network parameters to minimize the loss.

[0085] The decoding and reconstruction module is mainly implemented through a decoding network, which contains some convolutional layers, residual blocks, and upsampling layers, which can fuse F across resolutions and scales. LR and

[0086] Finally, the fused feature F fusion Compensate it into LR to get the final super-resolution image.

[0087] In addition, in order to obtain more accurate feature representation, the present invention applies two levels of supervision signals: at the intermediate feature level, the present invention limits the distance between the fused features and the HR features to expect a distribution similar to the HR image; at the final image level, the present invention uses three losses to limit the distance between the SR image and the HR image.

[0088] Figure 2 The specific process of steps 3 and 4 is shown.

[0089] The feature selection in step 3 consists of the following three stages:

[0090] Step 3-1: Relevance Embedding: It is through estimating F LR and F Ref The similarity between them is used to embed the correlation between LR and Ref images.

[0091] At this stage, it is necessary to calculate the correlation between each position of the LR image and all positions of the Ref image in order to find the source of the migration information of each position in the LR image. Since there is a resolution difference between the Ref image and the LR image, the present invention uses the Ref↓ image after 4× bicubic downsampling of the Ref image instead of the Ref image for correlation calculation:

[0092] First feature F LR and F Ref↓ It is expanded into many patches, denoted as q i (i∈[1,H LR ×W LR ]) and k j (j∈[1,H Ref ×W Ref ]), each position corresponds to a patch. Then for F LR Each patch q in i , and F is calculated by normalized inner product Ref↓ All patches in k j Relevance:

[0093]

[0094] where r i,j represents the correlation between the i-th position in the LR image and the j-th position in the Ref image;

[0095] Step 3-2: After obtaining the correlation, further calculation is performed to obtain the hard attention map H and the soft attention map S.

[0096] Hard-Attention: It selects the features to be migrated from Ref through the correlation between LR and Ref images.

[0097] Specifically, we first calculate a hard attention map H, where the i-th element h i (i∈[1,H LR ×W LR ]) is determined by the correlation r i , j Calculated:

[0098]

[0099] Among them, h i The value of can be viewed as an index, which represents the position in the Ref image that is most relevant to the i-th position in the LR image.

[0100] Then use the obtained hard attention map H to Ref The expanded patch V performs index selection operation:

[0101]

[0102] t i represents the value of T in the i-th image block, which is obtained from F Ref No.h i Finally, all t i (i∈[1,H LR ×W LR ]) Aggregate to obtain the HR feature T after feature matching. V is the reference image feature F Ref The expansion of F LR and F Ref↓ The same as the expansion.

[0103] Soft-Attention, soft attention:

[0104] In order to avoid that the information of each position in T is treated equally, we further use q i and k j The correlation r i,j , applying different attention weights to different positions of feature T. Specifically, first calculate a soft attention map S, where the i-th element s i (i∈[1,H LR ×W LR ]) Through the correlation r i,j The calculation results are:

[0105]

[0106] where s i represents the attention weight of feature T at the i-th position.

[0107] Step 3-3: Apply the obtained soft attention map S to the feature T to obtain the feature F for migration:

[0108] F=T⊙S

[0109] where the operator ⊙ represents element-wise multiplication between feature maps.

[0110] To save GPU space and reduce computation, correlation embedding is only applied to features at the smallest scale and further propagated to other scales.

[0111] Since the information of each channel of the reference image feature has different effects on LR, if the information of these channels is not taken into consideration and treated equally, it will affect the convergence of the network and the final effect, so further feature screening is needed.

[0112] Step 4 of the present invention proposes a feature adaptive module, and scales the features of each channel through adaptive learning to achieve the effect of enhancing important features and weakening noise. In the whole process, how to generate different attention for each channel is a key step.

[0113] The specific operations are as follows:

[0114] For a feature x of size C×H×W, we first use average pooling and maximum pooling operations to aggregate the spatial information of the feature map to generate two different channel descriptors z avg and z max , where the cth element is calculated from all elements of the cth channel:

[0115]

[0116]

[0117] where x c (i, j) is the value of the c-th channel feature at (i, j), H AP (·) is the global average pooling function, H MP (·) is the global maximum pooling function. Then the two channel descriptors will adaptively learn weights through a shared network:

[0118] s=σ(MLP(z avg +z max ))=σ(W U δ(W D (z avg +zmax )))

[0119] s=σ(MLP(z avg )+MLP(z max ))

[0120] =σ(W U δ(W D z avg )+W U δ(W D z max ))

[0121] Where s represents the weight vector of feature x, σ(·) and δ(·) represent the Sigmoid function and ReLU function respectively, and W D is the weight of the first layer of this shared network, W U is the weight of the second layer of this shared network. First, the two channel descriptors reduce the number of channels by a reduction ratio r. After being activated by ReLU, the second layer of the shared network increases the number of channels to the original size by a magnification ratio r. Finally, the channel weights of each layer are mapped to between 0 and 1 through the Sigmoid function. By reducing the channel dimension first and then increasing it, the number of network parameters is reduced. At the same time, the nonlinear relationship between the channel descriptor and the channel weight can be better learned through the two activation functions of ReLU and Sigmoid. Then the obtained channel weights are further applied to the input feature map x to achieve different attention to each channel:

[0122] y c =s c ·x c

[0123] where s c is the weight of the cth channel, x c is the cth channel feature, y c It is the new feature obtained by scaling the c-th channel feature of x by the channel dimension.

[0124] Through the above operation, the feature F obtained in step 4 is filtered in the channel dimension, and then the optimized migration feature is obtained.

[0125] Therefore, the process of feature F implementing channel dimension feature screening through the feature adaptation module can be described as:

[0126]

[0127] in is the final migration feature, W1 and W2 are the weights of the two convolutional layers of the residual block, and CAM represents the channel attention operation mentioned above.

[0128] Furthermore, in step 5, the final migration features are fused with the LR image features to achieve the final super-resolution reconstruction. The fusion is first applied to the smallest scale and then propagated upward to other scales one by one.

[0129] Since the reference-based image super-resolution model has a more complex network structure than the general model, it only uses the supervisory signal of the final image layer for optimization learning, which makes it difficult for the gradient to propagate, which brings certain difficulties to the training of the network.

[0130] This paper proposes a two-layer supervised learning strategy to obtain more accurate feature representation. Specifically, in the middle feature layer, this paper adopts an additional triple supervision loss To minimize the characteristics of HR images And the fusion feature F fusion Distance:

[0131]

[0132] Among them I HR represents the real image, represents the nth layer of the encoder, represents the features of HR image, F fusion Represents LR features and migration features The fusion characteristics of

[0133] The triple supervision represents the three scales of feature fusion features of HR images: 4x, 2x, and 1x;

[0134] At the final image layer, the present invention uses the following three losses for supervision:

[0135] Reconstruction loss.

[0136] The first loss is the reconstruction loss, which is used to measure the gap between the HR image and the SR image in pixel space:

[0137]

[0138] Among them I HR represents the real image, I SR Represents a super-resolution reconstructed image.

[0139] Perceptual loss.

[0140] The second loss is the perceptual loss, which has been shown to help improve visual quality and has been applied in SRGAN. Its core idea is to enhance the similarity between the predicted image and the target image in the feature space:

[0141]

[0142] in It is the feature map of the i-th layer of the VGG network. This paper uses the conv5_4 layer of the network, which is the last convolutional layer in the VGG network.

[0143] Adversarial loss.

[0144] The last loss is the adversarial loss. The generative adversarial network has been shown to be effective in generating clear and visually favorable images in RankSRGAN. Its core idea is to use the mutual game learning between the generative model G and the discriminative model D to produce better output:

[0145]

[0146]

[0147] Finally, the supervisory signals at both the intermediate feature layer and the image layer are combined to learn a more powerful feature representation:

[0148]

[0149] represents the total loss, represents the supervision loss, represents the reconstruction loss, represents the perceived loss, represents the generation adversarial loss, λ sup λ rec λ per λ adv Represent the weights of each loss respectively. Specific embodiment:

[0151] In the experiment, CUFED5 is mainly used as the training set, which consists of 11,871 pairs of training images, each pair of images contains an original HR image and a reference image with a resolution of 160×160.

[0152] In order to compare with other SR models, the present invention, like most methods, chooses to perform a bicubic downsampling operation on the original HR image by a factor of 4 to obtain the LR image. At the same time, in order to enhance the robustness of the model, data augmentation operations such as horizontal and vertical random flipping and random rotation of 90°, 180° and 270° are performed on the training set during training.

[0153] In the testing phase, in order to verify the generalization ability of the model, the present invention selects three public benchmark datasets, CUFED5 test set, Urban100 and Manga109, for testing.

[0154] There are 126 test images in the CUFED5 test set, each of which corresponds to 4 reference images with different similarities. Urban100 contains 100 architectural images without reference. Each image uses the LR image itself as a reference so that the network can explore the self-similarity of the input image. For Manga109, which also lacks reference images, its dataset is composed of simple lines and flat colored areas, so a HR image in the randomly sampled dataset is used as a reference image.

[0155] During the training process, Adam was selected as the training optimization algorithm, the parameters β1 and β2 were set to 0.9 and 0.999 respectively, and the initial learning rate was set to 10 -4 , and use the cosine annealing strategy to change the learning rate, and the learning rate is reduced to 10 every 500 epochs. -6 . Weight coefficient λ sup λ rec λ per λ adv Set to 0.5, 1, 1 and 0.005 respectively

[0156] In order to evaluate the effectiveness of the present invention, the present invention is compared with other advanced SISR and RefSR methods. SISR methods include SRCNN, MDSR, RDN, RCAN, SRGAN, ENet, ESRGAN, RSRGAN, and RefSR methods include SRNTT, TTSR, and MASA. All methods are trained on the CUFED5 training set and tested on the Urban100, Manga109, and CUFED5 test sets.

[0157] Table 1

[0158] Method CUFED5 Urban100 Manga109 SRCNN 25.33 / 0.745 24.41 / 0.738 27.12 / 0.850 MDSR 25.93 / 0.777 25.51 / 0.783 28.93 / 0.891 RDN 25.95 / 0.769 25.38 / 0.768 29.24 / 0.894 RCAN 26.06 / 0.769 25.42 / 0.768 29.38 / 0.895 SRGAN 24.40 / 0.702 24.07 / 0.729 25.12 / 0.802 ENet 24.24 / 0.695 23.63 / 0.711 25.25 / 0.802 ESRGAN 21.90 / 0.633 20.91 / 0.620 23.53 / 0.797 RSRGAN 22.31 / 0.635 21.47 / 0.624 25.04 / 0.803 SRNTT 25.61 / 0.764 25.09 / 0.774 27.54 / 0.862 SRNTT-rec 26.24 / 0.784 25.50 / 0.783 28.95 / 0.885 TTSR 25.53 / 0.765 24.62 / 0.747 28.70 / 0.886 TTSR-rec 27.09 / 0.804 25.87 / 0.784 30.09 / 0.907 MASA 24.92 / 0.729 23.78 / 0.712 27.23 / 0.845 MASA-rec 27.54 / 0.814 26.09 / 0.786 30.18 / 0.908 Ours 25.61 / 0.758 24.55 / 0.733 28.25 / 0.859 Ours-rec 27.63 / 0.820 26.20 / 0.790 30.55 / 0.912

[0159] As shown in Table 1, the present invention outperforms the most advanced methods on all three test sets. At the same time, the present invention further shows the comparison between the present invention and other methods in terms of network parameters, such as Figure 3 As shown, the evaluation is performed on the CUFED5 dataset with a scale factor of 4×, where the red dots represent the method of the present invention. In a network with parameters less than 5000K, the method of the present invention can obtain the best SR results. This shows that the present invention can well balance the number of parameters and reconstruction performance.

[0160] In order to more intuitively experience the effect of visual reconstruction, this paper also compares with other mainstream models such as ESRGAN, RSRGAN, TTSR, and MASA. Figure 4 The comparison of several methods on the reconstruction of faces, buildings, numbers and letters is shown. Figure 4As shown in the example in the upper right corner, the present invention almost successfully recovers the exact word, while other Ref methods produce more serious artifacts or blurring effects, which may be due to the effective utilization of reference image information by the attention model in the present invention.

[0161] also, Figure 4 Other examples in FIG. 4 also show that the images restored by the present invention are superior to those by other methods in terms of visual quality.

[0162] In Table 2, the effect of the correlation between LR and Ref images on the results is studied. Experiments are conducted on the CUFED5 test set, which has four reference images with different correlation levels. Among them, L1 and L4 represent the reference images provided by the CUFED5 test set, L1 is the most relevant level, and L4 is the least relevant level. LR refers to using the input image itself as the reference image. It can be seen from Table 2 that no matter what the correlation level of the reference image is, the present invention achieves the best effect, among which the performance of using L1 as the reference image is the best.

[0163] Table 2

[0164] Level SRNTT-rec TTSR-rec MASA-rec Ours-rec L1 26.15 / 0.781 26.99 / 0.800 27.35 / 0.814 27.49 / 0.819 L2 26.04 / 0.776 26.74 / 0.791 26.91 / 0.795 26.97 / 0.799 L3 25.98 / 0.775 26.64 / 0.788 26.82 / 0.793 26.86 / 0.795 L4 25.95 / 0.774 26.58 / 0.787 26.74 / 0.790 26.78 / 0.791 LR 25.91 / 0.776 26.43 / 0.782 26.59 / 0.784 26.63 / 0.790

[0165] In order to avoid subjective judgment of the experimental results, a user study was also conducted to further demonstrate the superiority of the proposed method from a qualitative perspective. A total of 10 users were asked to compare the visual quality of the proposed method and the latest technologies, including ESRGAN, RSRGAN, TTSR and MASA on the CUFED5 dataset. They were shown two images, one of which was the result of the proposed method, and asked to choose the image that provided better visual quality. Figure 5 As shown, more than 80% of the users believe that the results of the method of the present invention are better than those of the prior art.

[0166] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.

Claims

1. Image super-resolution reconstruction method based on hybrid attention and double-layer supervision, characterized in that: include: Step 1: Get the high-resolution label image HR and the reference image Ref and downsample them to obtain the corresponding low-resolution images LR and Ref↓. Perform data enhancement on HR, Ref, LR and Ref↓ to construct a dataset. Step 2: The multi-scale feature extraction module extracts multi-scale features from the images of the dataset through the encoder network. Both HR and Ref obtain three different scaling features, which are denoted as F HR and F Ref , LR and Ref↓ get F LR and F Ref↓ ; Step 3: The feature selection module uses transformer attention to select features from F based on the correlation between LR and Ref. Ref Obtain the corresponding feature F; Step 4 :The feature adaptation module uses channel attention to adaptively optimize F and obtain the optimized migration features Step 5: Encoding reconstruction module With F LR The fusion feature F is obtained by fusion of the decoder network fusion , the fused feature F fusion Compensate it into LR to obtain the final super-resolution image SR, achieve high-quality image reconstruction, and use a double-layer supervision signal to update the network parameters to minimize the loss; The feature selection module described in step 3 first embeds the correlation between LR and Ref, and then uses the correlation to extract the feature from F Ref Extract the information used to compensate for low-resolution image restoration as the corresponding features to be migrated on Ref. The specific process is as follows: Step 3-1: Estimate LR feature F LR and Ref↓ feature F Ref↓ The similarity between them is used to embed the correlation between LR and Ref images: F LR and F Ref↓ Expand into 3×3 small blocks and record them as q i (i∈[1,H LR ×W LR ]) and k j (j∈[1,H Ref ×W Ref ]), and calculate the correlation between small blocks by normalizing the inner product: r i,j represents the correlation between the i-th position in LR and the j-th position in Ref; Step 3-2: After obtaining the correlation, further calculation is performed to obtain the hard attention map H and the soft attention map S: First, a hard attention map H is calculated, where the i-th element h i (i∈[1,H LR ×W LR ]) is determined by the correlation r i,j Calculated: Among them, h i The value of can be regarded as an index, indicating the position in the Ref image that is most relevant to the i-th position in the LR image; Then use the obtained hard attention map H to Ref The expanded patch V performs index selection operation: t i represents the value of T in the i-th image block, which is obtained from F Ref No.h i Position selected; Finally, all t i (i∈[1,H LR ×W LR ]) Aggregate to obtain the HR feature T after feature matching; In order to avoid that the information of each position in T is treated equally, we further use q i and k j The correlation r i,j , apply different attention weights to different positions of feature T, specifically: First, a soft attention map S is calculated, where the i-th element s i (i∈[1,H LR ×W LR ]) Through the correlation r i,j The calculation results are: where s i represents the attention weight of feature T at the i-th position; Step 3-3: Apply the obtained soft attention map S to the feature T to obtain the feature F for migration: F=T⊙S Among them, the operator ⊙ represents the element-by-element multiplication between feature maps, and the feature F represents the corresponding feature to be migrated on Ref; The feature adaptation module described in step 4 uses the residual structure to apply channel attention to the feature F, adaptively applies different attention to each channel of the feature, and obtains the optimized migration feature. The channel attention uses two channel descriptors, average pooling and maximum pooling, to aggregate the spatial information of feature maps, and uses a shared network to map the channel descriptors into channel weight values ​​in a way of first reducing the dimension and then increasing the dimension; In step 4, adaptively applying different attention to each channel of the feature means adaptively scaling the channel features by learning the interdependence between channels. Specifically: For a feature map x of size C×H×W, we first aggregate the spatial information of the feature map using average pooling and maximum pooling operations to generate a channel descriptor z representing each channel avg and z max , where the cth element is calculated from all elements of the channel: Among them, x c (i, j) is the value of the c-th channel feature at (i, j), H AP (·) is the global average pooling function, H MP (·) is the global maximum pooling function; Then the channel descriptor z avg and z max Adaptively learn weights via a shared network: s=σ(MLP(z avg +with max ))=σ(W U δ(W D (With avg +with max ))) Among them, σ(·) and δ(·) represent the Sigmoid function and ReLU function respectively; W D is the weight of the first layer of the activation network, W U are the weights that activate the second layer of the network; The channel descriptor reduces the number of channels by a ratio of r, is activated by ReLU, and then increases by a ratio of r by the channel upscaling layer. Finally, the channel weights of each layer are mapped to between 0 and 1 through the Sigmoid function. The obtained channel weights are further applied to the input feature map x to achieve different attention for each channel: y c =s c ·x c Among them, s c is the weight of the cth channel, x c is the c-th channel feature; Through the above operation, the features obtained in step 4 are filtered in the channel dimension, and then the migration features after optimization are obtained. In step 5, the double-layer supervisory signal updates the network parameters: At the intermediate feature layer, an additional triple supervision loss is adopted To minimize the distance between the features of the HR image and the fusion features: Among them I HR represents the real image, represents the nth layer of the encoder, represents the features of HR image, F fusion Represents LR features and migration features The fusion characteristics of At the final image layer, three types of losses, namely reconstruction loss, perceptual loss and generative adversarial loss, are used to supervise and limit the distance between HR and the final super-resolution reconstructed image SR in pixel space and feature space, in the hope of restoring more realistic textures. Finally, the supervisory signals at the intermediate feature layer and the image layer are used to learn more powerful features.

2. The image super-resolution reconstruction method based on hybrid attention and double-layer supervision according to claim 1, characterized in that: In step 1, HR, Ref, LR and Ref↓ are horizontally or vertically flipped and randomly rotated by 90°, 180° and 270° to enhance the data.

3. The image super-resolution reconstruction method based on hybrid attention and double-layer supervision according to claim 1, characterized in that: The encoder network in step 2 contains three building blocks to extract features at three resolution scales: 1×, 2×, and 4×. Multi-scale feature extraction is performed on HR and Ref through the three building blocks of the encoder network, and three corresponding different scaling features are obtained; The first building block of the encoder network extracts features from LR and Ref↓ to obtain feature F LR and F Ref↓ .