Sequence image super-resolution reconstruction method based on Transformer and CNN hybrid network

Through a hybrid network based on Transformer and CNN, combined with the multi-head attention mechanism and the self-attention mechanism, it solves the problem of insufficient details in the existing technology when processing sub-pixel displacement sequence images, achieves higher-quality image reconstruction, and improves the The application effect of super-resolution technology.

CN118429188BActive Publication Date: 2024-10-29HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410593329.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-10-29
Estimated Expiration
2044-05-14

AI Technical Summary

Technical Problem

Existing super-resolution technology cannot make full use of the subtle displacement information between images when processing sequence images with fixed sub-pixel displacements, resulting in less than ideal details of the reconstructed high-resolution images, limiting the wide application of the technology in practical applications. Deployment and effectiveness.

Method used

A sequence image super-resolution reconstruction method based on Transformer and CNN hybrid network is used to dynamically adjust the window size by constructing an upsampling module, a shallow feature extraction module, a deep feature extraction module and a reconstruction module, combined with a multi-head attention mechanism and a self-attention mechanism. To adapt to different magnification needs, it significantly improves the ability to reconstruct image details.

Benefits of technology

It achieves more accurate reconstruction of image details, significantly improves the overall quality of super-resolution images, enhances the applicability and efficiency of the model, can better capture local details and long-distance dependencies, and improves the quality and detail performance of the image. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429188B_ABST
    Figure CN118429188B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for super-resolution reconstruction of sequence images based on a mixture of CNN and Transformer, comprising: step 1: first, obtaining low-resolution sequence images and high-resolution images of a target in the same field of view as samples; step 2: constructing a super-resolution network for a sequence image based on a mixture of CNN and Transformer; step 3: constructing a total loss function L; step 4: training the hybrid super-resolution network through back propagation, continuously optimizing until L converges, and the obtained hybrid super-resolution model is used to reconstruct the sequence images to be processed, thereby generating corresponding high-resolution images. The present invention can accurately reconstruct the texture and details of an image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of super-resolution reconstruction of sequential images, and specifically to a super-resolution reconstruction method of sequential images based on a hybrid network of Transformer and CNN. Background Art

[0002] With the development of digital imaging technology, the demand for high-resolution images continues to grow. In many applications, such as surveillance security, remote sensing detection, and medical diagnosis, high-resolution images can provide richer information and help improve the accuracy of analysis and recognition. At present, super-resolution image reconstruction technology mainly reconstructs high-resolution images from low-resolution sequence images through software algorithms, hoping to improve image quality without increasing costs. This challenge is particularly evident when it comes to sequence images with fixed sub-pixel displacements. Sub-pixel displacements refer to small, fixed offsets in position between frames in a sequence of images, which provide additional spatial information for reconstructing high-resolution images.

[0003] Existing super-resolution techniques mainly rely on two methods: interpolation and learning-based methods. Although interpolation methods such as bilinear, bicubic, and Lanczos interpolation are simple to implement, they often cause image blur when magnified by a large factor and fail to restore high-frequency details, which is a serious limitation for applications that require extremely high image quality. Secondly, deep learning-based methods, especially those using convolutional neural networks (CNNs), have shown superior performance in the past few years and are able to generate higher quality images by learning from large amounts of image data. In addition, although CNNs can effectively handle super-resolution reconstruction of single-frame images, when processing sequential images containing sub-pixel displacements, existing CNN methods are usually unable to fully utilize this subtle displacement information between images, resulting in the reconstructed high-resolution images still being less than ideal in details.

[0004] In summary, although the existing technology has made certain progress in the super-resolution reconstruction of sequence images, there are still many deficiencies in the processing capabilities of image super-resolution quality. The existence of these problems limits the widespread deployment and effectiveness of super-resolution technology in practical applications. Summary of the invention

[0005] In order to solve the shortcomings of the above-mentioned prior art, the present invention proposes a sequence image super-resolution reconstruction method based on a hybrid network of Transformer and CNN, in order to accurately reconstruct the texture and details of the image, thereby improving the image spatial resolution.

[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:

[0007] The present invention provides a method for super-resolution reconstruction of sequential images based on a hybrid network of Transformer and CNN, comprising the following steps:

[0008] Step 1: Obtain low-resolution sequence images of the target in the same field of view With high resolution images ;in, represents the kth low-resolution image, are the length and width of the image respectively, is the number of channels of the image; Indicates the multiple of the high-resolution image relative to the low-resolution image;

[0009] Step 2: Construct a sequence image super-resolution network based on a mixture of CNN and Transformer, including: upsampling module, shallow feature extraction module, deep feature extraction module and reconstruction module;

[0010] Step 2.1, the upsampling module After restacking in the channel dimension and arranging them in the order of R, G, and B color channels, a sub-pixel convolution layer is used to upsample the features on each color channel to obtain the initial image. ;

[0011] Step 2.2: The shallow feature extraction module uses the first convolutional layer to extract the initial image Processing to obtain shallow features ;

[0012] Step 2.3: The deep feature extraction module is composed of N cascaded CNN-Transformer modules. After processing, the deep feature sequence { },in, represents the deep features output by the nth cascaded CNN-Transformer module; the deep features output by the Nth cascaded CNN-Transformer module are recorded as ;

[0013] Step 2.4: The reconstruction module uses the third convolutional layer The reconstructed super-resolution result image is obtained using formula (1): :

[0014] (1)

[0015] In formula (1), represents residual connection;

[0016] Step 3: Use formula (2) to construct the total loss :

[0017] (2)

[0018] In formula (2), represents texture loss, represents the mean absolute error loss function; and:

[0019] (3)

[0020] (4)

[0021] In formula (3), They are and Gram matrix on the Cth channel;

[0022] Step 4: Train the CNN and Transformer hybrid super-resolution network through the back-propagation algorithm and calculate the total loss To update the network parameters until the total loss Until convergence, the trained CNN and Transformer hybrid super-resolution model is obtained, which is used to reconstruct the low-resolution sequence images to be processed and obtain the corresponding high-resolution images.

[0023] The method for super-resolution reconstruction of sequential images based on a hybrid network of Transformer and CNN described in the present invention is characterized in that each CNN-Transformer module in the deep feature extraction module comprises a Transformer block, a CNN block and a convolutional layer with a dimension of 1×1. ;

[0024] Step 2.3.1: =1, the The Transformer block pairs in the cascaded CNN-Transformer module Process it and get Cascaded refined encoding features ;

[0025] Step 2.3.2: =1, the The CNN blocks in the cascaded CNN-Transformer module are Process it and get Cascaded convolution enhancement features ;

[0026] Step 2.3.3: = 1, the convolutional layer Using formula (5), we can get Deep Features :

[0027] (5)

[0028] In formula (5), Represents the concatenation operation in the channel dimension;

[0029] Step 2.3.4: =2,3,…, When The input is processed in the nth cascaded CNN-Transformer module, so that the Nth cascaded CNN-Transformer module obtains the Deep Features .

[0030] The said The Transformer blocks in the cascaded CNN-Transformer module include: The multi-head attention mechanism layer and A feed-forward neural network;

[0031] Step 2.3.1.1, when n=1, The multi-head attention mechanism layer is divided into two layers according to the window size of S×S. After dividing the pixels in, the size is Several feature blocks are formed, and each feature block is expanded in the channel dimension and reorganized into the dimension The feature block sequence ,in, represents the length of the feature block sequence, and , is the width of the feature block sequence, and ; Indicates the length of the feature block, Indicates the width of the feature block;

[0032] Step 2.3.1.2, The j-th self-attention layer in the multi-head attention mechanism layer is transformed by different linear Process it and get The j-th query vector of the cascade , the jth key vector of the nth cascade , No. The j-th value vector of the cascade ,in, Respectively represent The weight matrices corresponding to the three linear transformations in the j-th self-attention layer in the Transformer block of the cascaded CNN-Transformer module are obtained by using formula (6). The j-th self-attention feature of the cascade :

[0033] (6)

[0034] In formula (6), d represents the dimension of the key vector, represents the activation function; represents transpose;

[0035] Step 2.3.1.3, After aggregating the self-attention features output by all self-attention heads in the cascaded CNN-Transformer modules, we get Aggregated multi-head attention features , and enter After being processed in the feedforward neural network of the Transformer block of the cascaded CNN-Transformer module, the Cascaded refined encoding features .

[0036] The said The CNN blocks in the cascaded CNN-Transformer module include: a first branch and an nth second branch; wherein the nth The first branch includes: global pooling layer Avg-pool, fully connected layer and fully connected layers ; said The second branch includes: several convolutional layers;

[0037] Step 2.3.2.1, when n=1, the global pooling layer Avg-pool of the nth first branch is Two-dimensional features on each channel Compressed to 1 real number, the dimension is After the global vector, The fully connected layer of the first branch , thereby reducing the channel dimension of the global vector to 1 / S, and the output dimension is The efficient representation vector is finally passed through the fully connected layer of the first branch of n The processing of efficiently representing the vector dimension is raised back to , and after transformation by the sigmoid function, the nth normalized weight vector is obtained ;

[0038] Step 2.3.2.2, when n=1, the convolutional layers of the nth second branch are sequentially After processing, the channel optimization features are obtained , and then use formula (7) to get Convolution-enhanced features of the CNN blocks output in the cascaded CNN-Transformer modules :

[0039] + (7)

[0040] In formula (7), + represents residual connection.

[0041] The electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the method for super-resolution reconstruction of sequential images, and the processor is configured to execute the program stored in the memory.

[0042] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the sequence image super-resolution reconstruction method when the computer program is executed by a processor.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] 1. The present invention innovatively combines the architectural advantages of convolutional neural networks (CNNs) and Transformers to construct a hybrid network that cleverly integrates the advantages of CNNs in extracting local features and the ability of Transformers in capturing long-distance dependencies. This design strategy not only successfully makes up for the defect of the traditional single CNN model in insufficient reconstruction of subtle structures in processing sequence image tasks, but also overcomes the limitations of the single Transformer model, which has high computational complexity and difficulty in capturing local features. Therefore, the present invention can reconstruct image details more accurately and significantly improve the overall quality of super-resolution images.

[0045] 2. The present invention dynamically adjusts the window size of the multi-head attention mechanism to match the magnification scale S, so that the model can flexibly adapt to various magnification requirements; this design maintains the sub-pixel information correlation of the local area of ​​the image, and provides a systematic method to handle image reconstruction tasks with different magnifications; such optimization not only improves the image quality, but also enhances the applicability and efficiency of the model;

[0046] 3. The multi-head attention mechanism in the present invention cuts the image feature map into small blocks by using an S×S window size, and each attention head focuses more accurately on a specific sub-pixel area in the image; this method significantly enhances the model's ability to process sub-pixel area information and improves the accuracy of capturing local details, thereby achieving higher reconstruction accuracy in sequence image reconstruction, effectively improving the image quality and detail performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a structural schematic diagram of a method for super-resolution reconstruction of sequential images based on a hybrid network of Transformer and CNN of the present invention;

[0048] Figure 2 A schematic diagram of generating a training data set of the present invention;

[0049] Figure 3 This is a schematic diagram of the hybrid network structure based on Transformer and CNN in the present invention;

[0050] Figure 4 This is a schematic diagram of the Transformer module structure of the present invention;

[0051] Figure 5 This is a schematic diagram of the multi-head attention mechanism module of the present invention;

[0052] Figure 6 This is a schematic diagram of the CNN module structure of the present invention;

[0053] Figure 7 This is a comparison diagram of the super-resolution result images generated by the present invention and other reconstruction methods in this embodiment. DETAILED DESCRIPTION

[0054] In this example, in order to efficiently process sequential images with fixed sub-pixel displacements and significantly improve the image detail reconstruction capability and image quality, a sequential image super-resolution reconstruction method based on a mixture of CNN and Transformer is proposed. By combining the Transformer's ability to capture long-distance dependencies with the CNN's advantages in local feature extraction, and dynamically adjusting the window size of the multi-head attention mechanism to adapt to the magnification scale number S, the present invention aims to accurately reconstruct the texture and details of the image. This not only effectively improves the visual perception quality of the image, but also increases its practical value, especially in key areas such as medical imaging, satellite imaging, and security monitoring, which can help professionals obtain clearer image information, thereby supporting more accurate decision-making and analysis. Specifically, if Figure 1 As shown, the method comprises the following steps:

[0055] Step 1: Get a high-resolution image of the target in the same field of view and low-resolution sequence images And the shooting is performed horizontally and vertically with a step size of 1 pixel, and the obtained A low-resolution image with pixel displacement; where represents the kth low-resolution image, are the length and width of the image respectively, is the number of channels of the image, Indicates the multiple of the high-resolution image relative to the low-resolution image;

[0056] The present invention combines the supervised super-resolution reconstruction method in deep learning, and requires high-resolution images corresponding to low-resolution sequence images as learning labels. This specific implementation uses a self-built dataset to train the proposed super-resolution reconstruction model:

[0057] The method for generating a dataset involves using different positional relationships of pixel blocks in a high-resolution image to generate low-resolution pixels with clear pixel displacements. Specifically, a pixel window is set to slide on the high-resolution image, and the pixels in the window are downsampled according to the set pixel displacement relationship to obtain a low-resolution sequence image. For example, in order to generate a training dataset with an enlarged scale of ×2, such as Figure 2 As shown, the window size is set to 2×2 and the step size is 2. The window is slid horizontally and vertically on the high-resolution image to obtain 4 adjacent pixels. The pixel value of each low-resolution image is determined by the average value of the four pixels in the corresponding window, so as to achieve downsampling of the high-resolution image. The starting position of the window of each low-resolution image is offset by one pixel in the horizontal or vertical direction, and the generated series of images have clear pixel displacements. The first frame of the image is used as the reference frame, and the pixel displacement relationships of the remaining images are theoretically (0.5, 0), (0,0.5) and (0.5, 0.5) respectively;

[0058] In the same way, for the training datasets with magnification scales of ×3 and ×4, 3×3 and 4×4 window sizes are used for downsampling in the generation process, and 9 and 16 low-resolution sequence images are generated respectively; the training datasets of all scales use 800 high-resolution images in the DIV2K dataset as samples, and these images are downsampled according to different magnification scales, thereby generating low-resolution sequence images with different pixel displacements as training sets;

[0059] Step 2: Construct a hybrid sequence image super-resolution network based on CNN and Transformer, which can learn more image structure and detail information from low-resolution sequence images with clear pixel displacements, and reconstruct images with clearer and richer details based on the learned feature mapping. In the CNN module and Transformer module, the network combines the channel attention mechanism and the self-attention mechanism, respectively, focusing on extracting sub-pixel information from different feature channels and feature spaces, and effectively establishes the mapping relationship between low-resolution sequence images and high-resolution images, such as Figure 3 As shown, it includes: an upsampling module, a shallow feature extraction module, a deep feature extraction module and a reconstruction module;

[0060] Step 2.1: The upsampling module first performs pixel shifting on the low-resolution sequence image. The channel dimension is re-stacked so that the input tensor is arranged in the order of R, G, and B color channels to ensure the consistency of the image color channels during the upsampling process; then the sub-pixel convolution layer is used to upsample each color channel to obtain the initial image ;

[0061] Step 2.2: The shallow feature extraction module uses the first convolutional layer to extract the initial image Processing is performed to expand the image information into the feature channel to obtain shallow features ;

[0062] Step 2.3: The deep feature extraction module consists of N cascaded CNN-Transformer modules, which mine and learn image features, and further integrate the redundant information contained in the feature channel by combining the channel attention mechanism and the self-attention mechanism. Each CNN-Transformer module contains a Transformer block, a CNN block, and a convolutional layer with a dimension of 1×1. ;

[0063] Shallow Features The deep feature extraction module is input and processed by N cascaded CNN-Transformer modules to output a deep feature sequence { },in, Indicates The deep features output by the Nth cascaded CNN-Transformer module are recorded as ;

[0064] Step 2.3.1, The Transformer blocks in the cascaded CNN-Transformer modules are as follows: Figure 4 As shown, including: The multi-head attention mechanism layer and A feed-forward neural network; image features need to be cut and expanded before entering the Transformer module to enhance the ability to capture pixel relationships;

[0065] Step 2.3.1.1, as Figure 5 As shown, when n=1, the The multi-head attention mechanism layer is divided into two layers according to the window size of S×S. After dividing the pixels in, the size is Several feature blocks are formed, and each feature block is expanded in the channel dimension and reorganized into the dimension The feature block sequence ,in, represents the length of the feature block sequence, and , is the width of the feature block sequence, and ; Indicates the length of the feature block, In order to maintain the correlation of local pixels and prevent the loss of pixel displacement information, the present invention cuts the feature map into different sizes in the network with different magnification factors S. For example, when the magnification factor is ×3, the image features are cut into 3×3 feature blocks. Then, the feature block sequence Input into the Transformer module to further learn image features;

[0066] Step 2.3.1.2: The j-th self-attention layer of the Transformer block in the n-th cascaded CNN-Transformer module is transformed by different linear transformations. Process it and get The j-th query vector of the cascade , the jth key vector of the nth cascade , No. The j-th value vector of the cascade ,in, Respectively represent Transformer blocks in a cascaded CNN-Transformer module The weight matrices corresponding to the three linear transformations in the j-th self-attention layer of The j-th self-attention feature of the cascade :

[0067] (1)

[0068] In formula (1), d represents the dimension of the key vector, represents the activation function; represents transpose;

[0069] Step 2.3.1.3, After aggregating the self-attention features output by all self-attention heads in the cascaded CNN-Transformer modules, we get Aggregated multi-head attention features , and enter After being processed in the feedforward neural network of the Transformer block of the cascaded CNN-Transformer module, the Cascaded refined encoding features ;

[0070] Step 2.3.2, The CNN blocks in the cascaded CNN-Transformer modules use the channel attention mechanism to integrate the channel information of the feature map. The attention mechanism aims to enhance the importance of different feature channels in the model and give greater weight to channels with more prominent features, such as Figure 6 As shown, including: The nth first branch and the nth second branch respectively calculate and reconstruct the channel features; The first branch includes: global pooling layer Avg-pool, fully connected layer and fully connected layers ;No. The second branch includes several 3×3 convolutional layers;

[0071] Step 2.3.2.1, when n=1, the global pooling layer of the nth first branch is Two-dimensional features on each channel Compressed to 1 real number, the dimension is The global vector of each channel for:

[0072] (2)

[0073] In formula (2), Representative feature map The pixel position of

[0074] After the The fully connected layer of the first branch , thereby reducing the channel dimension of the global vector to 1 / S, and the output dimension is The efficient representation vector is finally passed through the fully connected layer of the first branch of n The processing of efficiently representing the vector dimension is raised back to , and after transformation by the sigmoid function, the nth normalized weight vector is obtained ;

[0075] Step 2.3.2.2, when n=1, the nth second branch of several 3×3 convolutional layers are sequentially After processing, the channel optimization features are obtained , and then use formula (4) to get the Convolution-enhanced features of the CNN blocks output in the cascaded CNN-Transformer modules :

[0076] + (3)

[0077] In formula (3), + represents residual connection;

[0078] Step 2.3.3, Convolutional layer For splicing features Perform channel compression and use formula (4) to get Deep Features :

[0079] (4)

[0080] In formula (4), Represents the concatenation operation in the channel dimension;

[0081] Using formula (5), we can get the deep features of the output of N cascaded CNN-Transformer modules: :

[0082]

[0083] Step 2.4: Shallow Features Contains more local details and edge information, while deep features The global context structure is captured. The reconstruction module uses the third convolutional layer Shallow features of the connection and deep features Processing is performed to promote the effective fusion of features of different scales; the feature information after convolution processing is combined with the initial image Add together to more effectively approximate the true state of the high-resolution image, accelerate the training process and improve the reconstruction quality. Using formula (6), we can get the reconstructed super-resolution result map :

[0084] (6)

[0085] In formula (6), represents residual connection;

[0086] Step 3: Use formula (7) to construct the total loss :

[0087] (7)

[0088] In formula (7), represents the texture loss, and the super-resolution image generated by comparing and real high-resolution images The difference between the Gram matrices of the feature representations is measured to ensure that the generated image is not only close to the original image at the pixel level, but also consistent with the original image in texture distribution; Represents the mean absolute error loss function, which calculates the high-resolution image at each pixel position With super-resolution images The absolute difference between them focuses on reducing the brightness difference at the pixel level and promoting a close match between the generated image and the target image in terms of brightness and structure; it can be expressed as:

[0089] (8)

[0090] (9)

[0091] In formula (8), They are and The Gram matrix on the Cth channel is a matrix composed of the inner product of the feature vectors, reflecting the correlation between different features. The model aims to minimize the difference in pixel-level differences and texture similarity between the generated super-resolution image and the real high-resolution image.

[0092] Step 4: Train the CNN and Transformer hybrid super-resolution network through the back-propagation algorithm and calculate the total loss To update the network parameters, this process continues until the total loss Until convergence, the trained CNN and Transformer hybrid super-resolution model is obtained, which is used to reconstruct the low-resolution sequence images to be processed and obtain the corresponding high-resolution images. .

[0093] The effect of the present invention is further described below in conjunction with experiments:

[0094] The proposed pixel-shifted image super-resolution network is trained using a single NVIDIA RTX 3090 GPU using the Pytorch architecture. The optimizer uses momentum decay rates of and The model training process is 1000 epochs in total, and the initial learning rate is , the learning rate is halved every 200 epochs. 16 sets of images are trained in each iteration cycle, where low-resolution sequence images are cropped into 48×48 image patches, and high-resolution image patches correspond to the magnification scales of ×2, ×3, and ×4, which are 96×96, 144×144, and 192×192, respectively.

[0095] In order to measure the performance of the present invention in super-resolution, it is compared with several super-resolution algorithms. These methods can be roughly divided into two categories. One is the traditional multi-image super-resolution algorithm, including the projection on convex sets (POCS) and interpolation methods, which directly interpolate the pixel displacement relationship between low-resolution sequence images to reconstruct high-resolution images; the other is the algorithm based on deep learning, such as SwinIR based on the Transformer network framework. This method performs well in the task of single-image super-resolution reconstruction, and its reconstruction effect is far better than most super-resolution networks based on convolutional neural networks. By comparing with advanced single-image super-resolution algorithms, the present invention can highlight the image information richness advantage brought by the reconstruction of sequence images under fixed sub-pixel displacement. All algorithms were tested on the Set5, Set14, BSD100 and Urban100 datasets regenerated using simulated pixel displacement. In addition, the present invention uses two evaluation indicators, peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM), to conduct a detailed evaluation of the super-resolution processing results of sequence images.

[0096] The comparison results in Table 1 clearly show that the present invention significantly surpasses other image reconstruction methods in terms of two key image quality evaluation indicators, peak signal-to-noise ratio and structural similarity. This proves that the present invention can more effectively improve the detail clarity and overall structural similarity of the image, thereby generating results that are closer to the original high-resolution image.

[0097] Table 1. Comparison of quantitative indicators of reconstructed images in public datasets

[0098]

[0099] Figure 7 The visual effect comparison between the sequence image super-resolution reconstruction network based on the Transformer and CNN hybrid network of the present invention and other methods is demonstrated, and the real high-resolution image used is selected from "img018" of the Urban100 dataset. Figure 7 Parts (a), (b), and (c) in the figure show the corresponding low-resolution image reconstruction results of the four algorithms when the magnification scale is ×2, ×3, and ×4. It can be clearly seen from the figure that the high-resolution image reconstructed by the present invention has a complete structure and clear details, and the reconstruction quality is much higher than that of other algorithms, and is closer to the real high-resolution image. Although the SwinIR network produces unrealistic textures locally when using a single image for reconstruction, the present invention introduces a sequence of images under fixed sub-pixel displacement, so that the network model can use richer image information, effectively avoiding the generation of unrealistic textures.

Claims

1. A super-resolution reconstruction method for sequence images based on a hybrid network of Transformer and CNN. It is characterized in that The steps include: Step 1: Obtain low-resolution sequence images of the target in the same field of view With high resolution images ;in, represents the kth low-resolution image, are the length and width of the image respectively, is the number of channels of the image; Indicates the multiple of the high-resolution image relative to the low-resolution image; Step 2: Construct a sequence image super-resolution network based on a mixture of CNN and Transformer, including: upsampling module, shallow feature extraction module, deep feature extraction module and reconstruction module; Step 2 specifically includes the following sub-steps: Step 2.1, the upsampling module After restacking in the channel dimension and arranging them in the order of R, G, and B color channels, a sub-pixel convolution layer is used to upsample the features on each color channel to obtain the initial image. ; Step 2.2: The shallow feature extraction module uses the first convolutional layer to extract the initial image Processing to obtain shallow features ; Step 2.3: The deep feature extraction module is composed of N cascaded CNN-Transformer modules. After processing, the deep feature sequence { },in, represents the deep features output by the nth cascaded CNN-Transformer module; the deep features output by the Nth cascaded CNN-Transformer module are recorded as ; Each CNN-Transformer module in the deep feature extraction module contains a Transformer block, a CNN block and a convolutional layer with a dimension of 1×1. ; Step 2.3 specifically includes the following sub-steps: Step 2.3.1: =1, the The Transformer block pairs in the cascaded CNN-Transformer module Process it and get Cascaded refined encoding features ; The said The Transformer blocks in the cascaded CNN-Transformer module include: The multi-head attention mechanism layer and A feedforward neural network; step 2.3.1 specifically includes the following sub-steps: Step 2.3.1.1, when n=1, The multi-head attention mechanism layer is divided into two layers according to the window size of S×S. After dividing the pixels in, the size is Several feature blocks are formed, and each feature block is expanded in the channel dimension and reorganized into the dimension The feature block sequence ,in, represents the length of the feature block sequence, and , is the width of the feature block sequence, and ; Indicates the length of the feature block, Indicates the width of the feature block; Step 2.3.1.2, The j-th self-attention layer in the multi-head attention mechanism layer is transformed by different linear Process it and get The j-th query vector of the cascade , the jth key vector of the nth cascade , No. The j-th value vector of the cascade ,in, Respectively represent The weight matrices corresponding to the three linear transformations in the j-th self-attention layer in the Transformer block of the cascaded CNN-Transformer module are obtained by using formula (6). The j-th self-attention feature of the cascade : (6) In formula (6), d represents the dimension of the key vector, represents the activation function; represents transpose; Step 2.3.1.3, After aggregating the self-attention features output by all self-attention heads in the cascaded CNN-Transformer modules, we get Aggregated multi-head attention features , and enter After being processed in the feedforward neural network of the Transformer block of the cascaded CNN-Transformer module, the Cascaded refined encoding features ; Step 2.3.2: =1, the The CNN blocks in the cascaded CNN-Transformer module are Process it and get Cascaded convolution enhancement features ; The said The CNN blocks in the cascaded CNN-Transformer module include: a first branch and an nth second branch; wherein the nth The first branch includes: global pooling layer Avg-pool, fully connected layer and fully connected layers ; said The second branch includes: a number of convolutional layers; step 2.3.2 specifically includes the following sub-steps: Step 2.3.2.1, when n=1, the global pooling layer Avg-pool of the nth first branch is Two-dimensional features on each channel Compressed to 1 real number, the dimension is After the global vector, The fully connected layer of the first branch , thereby reducing the channel dimension of the global vector to 1 / S, and the output dimension is The efficient representation vector is finally passed through the fully connected layer of the first branch of n The processing of efficiently representing the vector dimension is increased back to , and after transformation by the sigmoid function, the nth normalized weight vector is obtained ; Step 2.3.2.2, when n=1, the convolutional layers of the nth second branch are sequentially After processing, the channel optimization features are obtained , and then use formula (7) to get Convolution-enhanced features of the CNN blocks output in the cascaded CNN-Transformer modules : + (7) In formula (7), + represents residual connection; Step 2.3.3: = 1, the convolutional layer Using formula (5), we can get Deep Features : (5) In formula (5), Represents the concatenation operation in the channel dimension; Step 2.3.4: =2,3,…, When The input is processed in the nth cascaded CNN-Transformer module, so that the Nth cascaded CNN-Transformer module obtains the Deep Features ; Step 2.4: The reconstruction module uses the third convolutional layer The reconstructed super-resolution result image is obtained using formula (1): : (1) In formula (1), represents residual connection; Step 3: Use formula (2) to construct the total loss : (2) In formula (2), represents texture loss, represents the mean absolute error loss function; and: (3) (4) In formula (3), They are and Gram matrix on the Cth channel; Step 4: Train the CNN and Transformer hybrid super-resolution network through the back-propagation algorithm and calculate the total loss To update the network parameters until the total loss The trained CNN and Transformer hybrid super-resolution model is obtained until convergence, which is used to reconstruct the low-resolution sequence images to be processed and obtain the corresponding high-resolution images.

2. An electronic device comprising a memory and a processor, It is characterized in that The memory is used to store a program that supports the processor to execute the method for super-resolution reconstruction of sequential images according to claim 1, and the processor is configured to execute the program stored in the memory.

3. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method for super-resolution reconstruction of sequential images according to claim 1 are executed.

Citation Information

Patent Citations

  • Transformers-based low-resolution image super-resolution method and system

    CN112862690A

  • Hyperspectral remote sensing image super-resolution reconstruction method and device and computer equipment

    CN116309070A