Image super-resolution method and device based on non-local sparse attention

By performing channel sparse processing and spatial sparse processing on low-resolution images, combined with shallow feature maps, local and non-local feature processing of the image is achieved, which solves the problem of poor image reconstruction in the existing technology and improves super-resolution. Image quality.

CN117495679BActive Publication Date: 2024-09-03UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311460075.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2024-09-03
Estimated Expiration
2043-11-03

AI Technical Summary

Technical Problem

Existing image reconstruction methods have poor ability to learn global features of low-resolution images, resulting in poor image reconstruction results and possible irrelevant textures.

Method used

An image super-resolution method based on non-local sparse attention is used to extract shallow features of low-resolution images, perform channel sparse processing and spatial sparse processing, obtain a two-dimensional sparse feature map, and fuse it with the shallow feature map , and then perform convolution and upsampling processes to obtain super-resolution images.

Benefits of technology

It improves the reconstruction effect of low-resolution images, reduces artifacts, and obtains higher-quality super-resolution images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117495679B
    Figure CN117495679B
Patent Text Reader

Abstract

The present disclosure relates to an image super-resolution method and device based on non-local sparse attention, belonging to the technical field of image processing. The method comprises: acquiring a compressed low-resolution image; extracting shallow features of the low-resolution image to obtain a shallow feature map of the low-resolution image; performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map; fusing the two-dimensional sparse feature map with the shallow feature map to obtain a feature fusion map of the low-resolution image; performing convolution and upsampling processing on the feature fusion map to obtain a super-resolution image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the technical field of image processing, and more specifically, to an image super-resolution method and device based on non-local sparse attention. Background Art

[0002] With the rapid development of the information age, digital images, as an important form of information transmission, have higher requirements for resolution. At present, the existing image reconstruction methods will segment the features of low-resolution images to a certain extent. This method has poor learning ability for global features, and irrelevant textures may appear during image reconstruction, resulting in poor image reconstruction effect. Summary of the invention

[0003] One purpose of the embodiments of the present disclosure is to provide a new technical solution for an image super-resolution method and device based on non-local sparse attention.

[0004] According to a first aspect of the present disclosure, a non-local sparse attention-based image super-resolution method is provided, the method comprising:

[0005] Obtaining a compressed low-resolution image;

[0006] Extracting shallow features of the low-resolution image to obtain a shallow feature map of the low-resolution image;

[0007] Performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map;

[0008] Fusing the two-dimensional sparse feature map with the shallow feature map to obtain a feature fusion map of the low-resolution image;

[0009] The feature fusion image is convolved and up-sampled to obtain a super-resolution image.

[0010] Optionally, performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map includes:

[0011] Through the dual-dimensional sparse processing module, the shallow feature map is subjected to at least one channel sparse processing and then spatial sparse processing to obtain a dual-dimensional sparse feature map after at least one processing; wherein the dual-dimensional sparse processing module includes at least one group of channel sparse networks and spatial sparse networks connected in series; the shallow feature map is input into the first channel sparse network; the channel sparse network performs channel sparse processing on the input feature map to obtain a channel sparse feature map, and the spatial sparse network of the same group performs spatial sparse processing on the channel sparse feature map to obtain a processed depth sparse feature map; each spatial sparse network outputs a processed depth sparse feature map, and the processed depth sparse feature map output by the spatial sparse network of the previous group is input into the channel sparse network of the adjacent subsequent group to continue the channel sparse processing.

[0012] Optionally, performing channel sparse processing on the input feature map to obtain a channel sparse feature map includes:

[0013] Extracting non-local features of the input feature map to obtain a first reshaping matrix;

[0014] Obtain an attention map according to the vector of the first reshaped matrix;

[0015] According to a set screening mechanism, a set proportion of attention features are screened in the attention map;

[0016] A channel sparse feature map is obtained according to the attention feature, the preset first activation function and the vector.

[0017] Optionally, performing spatial sparse processing on the channel sparse feature map to obtain the processed depth sparse feature map includes:

[0018] According to a set block rule, the channel sparse feature map is divided into multiple groups of blocks;

[0019] Extracting local features of the plurality of groups of image blocks to obtain a second reshaping matrix;

[0020] Obtaining an attention map according to the vector of the second reshaped matrix;

[0021] A deep sparse feature map is obtained according to the attention map, the preset second activation function and the vector.

[0022] Optionally, after performing channel sparse processing on the input depth sparse feature map to obtain the channel sparse feature map, the method further includes:

[0023] The first high-frequency information in the channel sparse feature map is extracted by a first gated convolution feedforward network connected between the channel sparse network of the same group and the spatial sparse network of the same group; wherein the first high-frequency information is the image high-frequency information in the channel sparse feature map after channel sparse processing.

[0024] Optionally, after performing spatial sparse processing on the channel sparse feature map to obtain the processed depth sparse feature map, the method further includes:

[0025] Through the second gated convolution feedforward network connected between the channel sparse network of the latter group and the spatial sparse network of the former group, the second high-frequency information in the deep sparse feature map is extracted; wherein the second high-frequency information is the image high-frequency information in the deep sparse feature map after spatial sparse processing.

[0026] Optionally, each gated convolution feed-forward network obtains high-frequency information of the image by extracting features of the input sparse network graph and a preset third activation function.

[0027] Optionally, performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map includes:

[0028] The steps of performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map are performed once by N two-dimensional sparse processing modules connected in series, respectively, to obtain the N processed deep feature maps; wherein N ≥ 2 and is an integer; the shallow feature map is input to the first two-dimensional sparse processing module; the two-dimensional sparse processing module performs at least one channel sparse processing and at least one spatial sparse processing on the features of the input feature map to obtain a processed deep feature map; each two-dimensional sparse processing module outputs a processed deep feature map, and the processed deep feature map output by the previous two-dimensional sparse processing module is input to the adjacent next two-dimensional sparse processing module to continue the two-dimensional sparse processing; a two-dimensional sparse feature map is obtained according to the shallow feature map and the N processed deep feature maps.

[0029] According to a second aspect of the present disclosure, there is also provided an image super-resolution device based on non-local sparse attention, the device comprising:

[0030] An image acquisition module, used for acquiring a compressed low-resolution image;

[0031] A feature acquisition module, used to extract shallow features of the low-resolution image to obtain a shallow feature map of the low-resolution image;

[0032] A feature processing module, used for performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map;

[0033] A feature fusion module, used for fusing the two-dimensional sparse feature map with the shallow feature map to obtain a feature fusion map of the low-resolution image;

[0034] The image acquisition module is used to perform convolution and up-sampling processing on the feature fusion image to obtain a super-resolution image.

[0035] According to the third aspect of the present disclosure, there is also provided an image super-resolution device based on non-local sparse attention, comprising a memory and a processor, wherein the memory is used to store a computer program; the processor is used to execute the computer program to implement the method described in the first aspect of the present disclosure.

[0036] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.

[0037] One beneficial effect of the embodiments of the present disclosure is that, through the channel sparse processing of the channel sparse network and the spatial sparse processing of the spatial sparse network, the local features and non-local features of the low-resolution image are processed, thereby improving the reconstruction effect of the low-resolution image and reducing the generation of artifacts, thereby obtaining a higher quality super-resolution image.

[0038] Other features and advantages of the embodiments of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the embodiments of the present disclosure.

[0040] Figure 1 is a schematic diagram of the composition structure of a non-local sparse attention-based image super-resolution system to which the non-local sparse attention-based image super-resolution method according to one embodiment can be applied;

[0041] Figure 2 is a flowchart of an image super-resolution method based on non-local sparse attention according to an embodiment;

[0042] Figure 3 is a schematic diagram of a channel sparse network structure according to an embodiment;

[0043] Figure 4is a schematic diagram of a structure of a spatial sparse network according to an embodiment;

[0044] Figure 5 is a schematic diagram of the structure of a dual-dimensional sparse processing module according to an embodiment;

[0045] Figure 6 is a schematic diagram of the structure of a gated convolutional feedforward network according to one embodiment;

[0046] Figure 7 is a schematic diagram of the composition of a dual-dimensional sparse processing module according to an embodiment;

[0047] Figure 8 is a schematic diagram of the composition of a residual sparse Trasformer group according to an embodiment

[0048] Fig. 9 is a block diagram of an image super-resolution device based on non-local sparse attention according to an embodiment;

[0049] Fig.10 Schematic diagram of the hardware structure of an image super-resolution device based on non-local sparse attention according to one embodiment. DETAILED DESCRIPTION

[0050] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0051] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0052] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0053] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0054] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0055] <System Embodiment>

[0056] Figure 11 is a schematic diagram of the composition structure of a non-local sparse attention-based image super-resolution system to which the non-local sparse attention-based image super-resolution method according to one embodiment can be applied. Figure 1 As shown, the system includes an image sending device 1000 and an image receiving device 2000, and the system can be applied to image processing scenarios.

[0057] The image sending device 1000 can be connected to the image receiving device 2000 in a wired or wireless communication manner. The image sending device 1000 can compress some images into low-resolution images and send them to the image receiving device 2000. The image receiving device 2000 reconstructs the image after receiving the compressed low-resolution image and can obtain a super-resolution image for display.

[0058] The image transmitting apparatus 1000 may also include a processor 1100 , a memory 1200 , an interface device 1300 , and a communication device 1400 .

[0059] The image receiving device 2000 may also include a processor 2100 , a memory 2200 , an interface device 2300 , and a communication device 2400 .

[0060] The processors 1100 and 1200 are used to execute computer programs, which can be written in instruction sets of architectures such as x86, Arm, RISC, MIPS, SSE, etc. The memories 1200 and 2200 include, for example, ROM (read-only memory), RAM (random access memory), non-volatile memory such as a hard disk, etc. The interface devices 1300 and 2300 include, for example, USB interfaces, video interfaces, network interfaces, etc. The communication devices 1400 and 2400 can, for example, perform wired or wireless communications. The communication device 1400 may include at least one short-range communication module, for example, any module for short-range wireless communications based on short-range wireless communication protocols such as Hilink protocol, WiFi (IEEE 802.11 protocol), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, LiFi, etc. The communication device 1400 may also include a remote communication module, for example, any module for WLAN, GPRS, 2G / 3G / 4G / 5G remote communications.

[0061] The memory 2200 of the image receiving device 2000 is used to store a computer program, which is used to control the processor 2100 to operate to execute the image super-resolution method based on non-local sparse attention according to any embodiment of the present disclosure, so as to reconstruct a high-resolution original image from the received low-resolution image and complete image restoration. A technician can design a computer program according to the method steps, and how the computer program controls the processor to operate is a well-known technology in the art, so it will not be described in detail here.

[0062] The above image sending device 1000 and image receiving device 2000 may be any electronic device with image processing capability, for example, any type of user terminal device, or a server, etc., which is not limited here.

[0063] <Method Example>

[0064] Figure 2 FIG. 1 is a flow chart of an image super-resolution method based on non-local sparse attention according to an embodiment. The implementation subject is, for example, Figure 1 The image receiving device 2000 is shown in FIG.

[0065] like Figure 2 As shown, the image super-resolution method based on non-local sparse attention in this embodiment may include the following steps S210 to S250:

[0066] Step S210: obtaining a compressed low-resolution image.

[0067] In this embodiment, the low resolution is a resolution lower than the resolution specified by the image sending device 1000 , and the specified resolution is, for example, 320×240, 1024×768 or 1600×1280, which is not limited here.

[0068] In some examples, the low-resolution image may be a multi-channel color image, such as an RGB three-channel, 8-channel, 16-channel, or 32-channel color image.

[0069] Step S220, extracting shallow features of the low-resolution image to obtain a shallow feature map of the low-resolution image.

[0070] In some embodiments, shallow features of the low-resolution image are extracted through a 3×3 convolutional layer, and a shallow feature map of the low-resolution image is obtained.

[0071] Step S230, performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map.

[0072] In this embodiment, the features of the low-resolution image may include local features and non-local features, wherein the local features are the features of the multiple blocks into which the image is cut, and the non-local features are the features that reflect the overall effect of the image. The shallow feature map of the low-resolution image can be subjected to different times of sparse processing to obtain a two-dimensional sparse feature map. For example, the shallow feature map of the low-resolution image can first be subjected to at least one channel sparse processing to obtain a channel sparse feature map, and then the channel sparse feature map is subjected to at least one spatial sparse processing to obtain a two-dimensional sparse feature map. For another example, the shallow feature map of the low-resolution image can first be subjected to at least one spatial sparse processing to obtain a spatial sparse feature map, and then the spatial sparse feature map is subjected to at least one channel sparse processing to obtain a two-dimensional sparse feature map. For another example, the shallow feature map of the low-resolution image can be subjected to channel sparse processing and spatial sparse processing at the same time to obtain a channel sparse feature map and a spatial sparse feature map, and the two are fused to obtain a two-dimensional sparse feature map.

[0073] In some embodiments, step S230 may include the following contents: performing channel sparse processing and then spatial sparse processing on the shallow feature map of the low-resolution image at least once through a two-dimensional sparse processing module to obtain a two-dimensional sparse feature map after at least one processing; wherein the two-dimensional sparse processing module includes at least one group of channel sparse networks and spatial sparse networks connected in series; the shallow feature map is input to the first channel sparse network; the channel sparse network performs channel sparse processing on the input feature map to obtain a channel sparse feature map, and the spatial sparse network of the same group performs spatial sparse processing on the channel sparse feature map to obtain a processed depth sparse feature map; each spatial sparse network outputs a processed depth sparse feature map, and the processed depth sparse feature map output by the spatial sparse network of the previous group is input to the channel sparse network of the adjacent subsequent group to continue the channel sparse processing.

[0074] For example, the dual-dimensional sparse processing module includes two groups of channel sparse networks and spatial sparse networks. The spatial sparse network of the first group is connected in series with the channel sparse network of the second group. The first group of channel sparse networks performs channel sparse processing on the shallow feature map to obtain a first channel sparse feature map, the first group of spatial sparse network performs spatial sparse processing on the channel sparse feature map to obtain a spatial sparse feature map, the second group of channel sparse network performs channel sparse network processing on the spatial sparse feature map to obtain a second channel sparse feature map, and the second group of spatial sparse network performs spatial sparse processing on the second channel sparse feature map to obtain a dual-dimensional sparse feature map.

[0075] The channel sparse network is, for example, a channel sparse Transformer network, and the spatial sparse network is, for example, a spatial sparse Transformer network.

[0076] In other words, by first performing channel sparse processing and then performing spatial sparse processing on the shallow feature map, the amount of calculation of the two-dimensional sparse feature map can be effectively reduced, thereby saving computing resources.

[0077] In some embodiments, channel sparse processing is performed on the input feature map to obtain a channel sparse feature map, which includes the following process: extracting non-local features of the input feature map to obtain a first reshaping matrix; obtaining an attention map based on the vector of the first reshaping matrix; filtering a set proportion of attention features in the attention map according to a set filtering mechanism; and obtaining a channel sparse feature map based on the attention features, a preset first activation function and a vector.

[0078] In some examples, such as Figure 3 As shown, for the input feature map, the corresponding non-local features can be extracted through 1 layer normalization, 1 1×1 convolution layer and 1 3×3 convolution layer, that is, the first reshaped matrix representing the non-local features can be calculated. The vectors of the first reshaped matrix are the three vectors of query Q, key K and value V, and the query Q and key K are matrix multiplied in the channel dimension after layer normalization to obtain the attention map. The set screening mechanism is, for example, the Top-K mechanism, and the attention features of the first K can be screened out, where K is, for example, 50%, 60% or 70%, etc., which is not limited here. The Top-K mechanism is used for the attention map, and the attention features of the first K are screened to achieve content sparseness. The preset first activation function is, for example, RELU, and the first K attention features screened out are used with the first activation function, and the matrix is ​​multiplied with the above value V in the channel dimension to obtain the output result, and the output result is matrix reshaped and then passed through a 1×1 convolution layer to form a channel sparse feature map.

[0079] In some embodiments, spatial sparse processing is performed on the channel sparse feature map to obtain a processed depth sparse feature map, which includes the following process: dividing the channel sparse feature map into multiple groups of blocks according to a set blocking rule; extracting local features of the multiple groups of blocks to obtain a second reshaping matrix; obtaining an attention map based on a vector of the second reshaping matrix; and obtaining a depth sparse feature map based on the attention map, a preset second activation function and a vector.

[0080] In some examples, such as Figure 4As shown, the set block rule can be a slicing operation based on position sparseness, and the input channel sparse feature map is marked pixel by pixel with an interval size I, and the same mark is divided into the same group, so as to realize the re-slicing of the channel sparse feature map to achieve position sparseness. Through this block rule, the input channel sparse feature map is divided into multiple groups of blocks, and then the local features of multiple groups of blocks are extracted through 1 layer normalization, 1 1×1 convolution layer and 1 3×3 convolution, and the second reshaping matrix representing the local features of multiple groups of blocks is calculated. Among them, the preset second activation function is, for example, a RELU activation function. The vectors of the second reshaping matrix are the three vectors of query Q, key K and value V. The query Q and key K are matrix-multiplied in the spatial dimension after layer normalization to obtain an attention map, and the attention map is input into the activation function, and the output result is obtained by matrix multiplication with the above value V in the spatial dimension, and then the output result is matrix reshaped and then passed through a 1×1 convolution layer to form a deep sparse feature map.

[0081] In some embodiments, after obtaining the channel sparse feature map, the method also includes the following: extracting the first high-frequency information in the channel sparse feature map through a first gated convolutional feedforward network connected between the channel sparse network of the same group and the spatial sparse network of the same group; wherein the first high-frequency information is the image high-frequency information in the channel sparse feature map after channel sparse processing.

[0082] In some examples, such as Figure 5 As shown, each two-dimensional sparse processing module may include a channel sparse network, a first gated convolution feedforward network, a spatial sparse network, and a second gated convolution feedforward network connected in series. The first gated convolution feedforward network can extract the first high-frequency information in the channel sparse feature map output by the channel sparse network, and the first high-frequency information may include image high-frequency information represented in the channel sparse feature map, and these image high-frequency information can enhance the network's expression of texture information.

[0083] In some embodiments, after obtaining the processed deep sparse feature map, the method also includes the following: extracting second high-frequency information in the deep sparse feature map through a second gated convolutional feedforward network connected between the channel sparse network of the latter group and the spatial sparse network of the former group; wherein the second high-frequency information is the image high-frequency information in the deep sparse feature map after spatial sparse processing.

[0084] In some examples, such as Figure 5 As shown, the second gated convolutional feedforward network can extract the second high-frequency information in the deep sparse feature map output by the spatial sparse network. The second high-frequency information can include high-frequency information of the image represented in the deep sparse feature map. These high-frequency information of the image can enhance the network's expression of texture information.

[0085] In some embodiments, each gated convolution feedforward network obtains high-frequency information of the image by extracting features of the input sparse network graph and a preset third activation function, wherein the third activation function is, for example, a GELU activation function.

[0086] In some examples, such as Figure 6 As shown, the first gated convolutional feed-forward network can obtain a first calculation result by extracting and calculating the features in the channel sparse feature map through 1 layer normalization, 1 1×1 convolution layer and 1 3×3 convolution, and input the first calculation result into the GELU activation function to obtain a second calculation result, and use the second calculation result as a coefficient to perform element-wise multiplication with the first calculation result to obtain a third calculation result, and pass the third calculation result through a 1×1 convolution layer to obtain a channel sparse feature map for extracting high-frequency information of the image.

[0087] In some examples, such as Figure 6 As shown, the second gated convolutional feed-forward network can also obtain a fourth calculation result by extracting and calculating the features in the depth sparse feature map through 1 layer normalization, 1 1×1 convolution layer and 1 3×3 convolution, and inputting the fourth calculation result into the GELU activation function to obtain a fifth calculation result, and multiplying the fifth calculation result by the fourth calculation result as a coefficient to obtain a sixth calculation result, and passing the sixth calculation result through a 1×1 convolution layer to obtain a depth sparse feature map of pixel points for extracting high-frequency information of the image.

[0088] The high-frequency information of the image may represent areas where the image intensity, such as brightness or grayscale, changes dramatically. These areas with dramatic changes may be, for example, texture or edge areas.

[0089] In some embodiments, step S220 may include the following contents: performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map through N serially connected two-dimensional sparse processing modules, respectively, to obtain N processed deep feature maps; wherein N ≥ 2 and is an integer; the shallow feature map is input to the first two-dimensional sparse processing module; the two-dimensional sparse processing module performs at least one channel sparse processing and at least one spatial sparse processing on the features of the input feature map to obtain a processed deep feature map; each two-dimensional sparse processing module outputs a processed deep feature map, and the processed deep feature map output by the previous two-dimensional sparse processing module is input to the adjacent next two-dimensional sparse processing module to continue the two-dimensional sparse processing; based on the shallow feature map and the N processed deep feature maps, a two-dimensional sparse feature map is obtained.

[0090] In some examples, such as Figure 7 and Figure 8As shown, a 3×3 convolutional layer is used to extract shallow features of a low-resolution image, and a shallow feature map of the low-resolution image is obtained. The shallow feature map is input into the first channel sparse network of the first two-dimensional sparse processing module. The first channel sparse network performs channel sparse processing on the shallow feature map to obtain a channel sparse feature map. The first spatial sparse network performs spatial sparse processing on the channel sparse feature map to obtain a deep sparse feature map. The deep sparse feature map is then input into the second channel sparse network for processing, and so on. The last spatial sparse network of the last two-dimensional sparse processing module can obtain a two-dimensional sparse feature map. The number of two-dimensional sparse processing modules is, for example, 3, 10, or so. Figure 7 There are 4 of them, which are not limited here, and each of the 4 dual-dimensional modules can be a group of residual sparse Trasformer groups, and the residual sparse Trasformer groups can be 3, 5, or as many as Figure 8 In other words, through the processing of the above-mentioned multiple dual-dimensional sparse processing modules, the coupled dual-dimensional content sparseness and position sparseness of the image can be achieved, while effectively reducing the number of parameters and the number of floating-point operations.

[0091] In some examples, such as Figure 8 As shown in FIG. 1 , after obtaining the two-dimensional sparse feature map, the features of the two-dimensional sparse feature map can be extracted through a 3×3 convolutional layer.

[0092] Step S240, fusing the two-dimensional sparse feature map with the shallow feature map to obtain a feature fusion map of the low-resolution image.

[0093] In some examples, such as Figure 8 As shown, the shallow feature map of the low-resolution image extracted by a 3×3 convolutional layer is fused with the features extracted from the two-dimensional sparse feature map to obtain a feature fusion map of the low-resolution image.

[0094] Step S250, performing convolution and upsampling processing on the feature fusion image to obtain a super-resolution image.

[0095] In some examples, such as Figure 8 As shown in FIG. 1 , a 3×3 convolution layer is used to extract the features of the feature fusion map and then upsample the map through sub-pixel convolution to obtain the corresponding super-resolution image.

[0096] In other words, through the channel sparse processing of the channel sparse network and the spatial sparse processing of the spatial sparse network, the local features and non-local features of the low-resolution image can be processed, thereby improving the reconstruction effect of the low-resolution image and reducing the generation of artifacts, thereby obtaining a higher quality super-resolution image.

[0097] In some examples, after acquiring the compressed low-resolution image, the method further includes training the channel sparse network and the spatial sparse network through training samples.

[0098] The channel sparse network and the spatial sparse network are trained through training samples, including:

[0099] The commonly used DIV2K dataset is used as a training sample. The commonly used DIV2K dataset includes multiple sets of low-resolution training images and corresponding high-resolution training images. After the low-resolution training images are input into the network, the processing results are output. The processing results and the high-resolution training images are calculated by the L1Loss function to obtain the loss value. According to the obtained loss value, the parameters in the overall network architecture are adjusted to correct the learning deviation. The network architecture here can be as follows Figure 8 The network architecture consists of 6 groups of residual sparse Trasformer groups.

[0100] <Equipment Example 1>

[0101] Fig. 9 is a principle block diagram of an image super-resolution device based on non-local sparse attention according to an embodiment. Fig. 9 As shown, the image super-resolution device 900 based on non-local sparse attention may include:

[0102] An image acquisition module 910 is used to acquire a compressed low-resolution image;

[0103] A feature acquisition module 920 is used to extract shallow features of the low-resolution image and obtain a shallow feature map of the low-resolution image;

[0104] A feature processing module 930 is used to perform at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map;

[0105] A feature fusion module 940 is used to fuse the two-dimensional sparse feature map with the shallow feature map to obtain a feature fusion map of the low-resolution image;

[0106] The image acquisition module 950 is used to perform convolution and up-sampling processing on the feature fusion image to obtain a super-resolution image.

[0107] Optionally, the feature processing module 930 is also used to perform at least one channel sparse processing and then spatial sparse processing on the shallow feature map through a two-dimensional sparse processing module to obtain a two-dimensional sparse feature map after at least one processing; wherein the two-dimensional sparse processing module includes at least one group of channel sparse networks and spatial sparse networks connected in series; the shallow feature map is input to the first channel sparse network; the channel sparse network performs channel sparse processing on the input feature map to obtain a channel sparse feature map, and the spatial sparse network of the same group performs spatial sparse processing on the channel sparse feature map to obtain a processed depth sparse feature map; each spatial sparse network outputs a processed depth sparse feature map, and the processed depth sparse feature map output by the spatial sparse network of the previous group is input to the channel sparse network of the adjacent subsequent group to continue the channel sparse processing.

[0108] Optionally, the feature processing module 930 is also used to extract non-local features of the input feature map to obtain a first reshaping matrix; obtain an attention map based on the vector of the first reshaping matrix; filter a set proportion of attention features in the attention map according to a set filtering mechanism; and obtain a channel sparse feature map based on the attention features, a preset first activation function and a vector.

[0109] Optionally, the feature processing module 930 is also used to divide the channel sparse feature map into multiple groups of blocks according to a set blocking rule; extract local features of the multiple groups of blocks to obtain a second reshaping matrix; obtain an attention map based on the vector of the second reshaping matrix; obtain a deep sparse feature map based on the attention map, a preset second activation function and a vector.

[0110] Optionally, the image super-resolution device 900 based on non-local sparse attention also includes a first information extraction module, which is used to extract first high-frequency information in the channel sparse feature map through a first gated convolutional feedforward network connected between the channel sparse network of the same group and the spatial sparse network of the same group; wherein the first high-frequency information is the image high-frequency information in the channel sparse feature map after channel sparse processing.

[0111] Optionally, the image super-resolution device 900 based on non-local sparse attention also includes a second information extraction module, which is used to extract second high-frequency information in the depth sparse feature map through a second gated convolutional feed-forward network connected between the channel sparse network of the latter group and the spatial sparse network of the former group; wherein the second high-frequency information is the image high-frequency information in the depth sparse feature map after spatial sparse processing.

[0112] The feature processing module 930 is also used to execute the steps of performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map through N two-dimensional sparse processing modules connected in series, so as to obtain N processed deep feature maps; wherein N ≥ 2 and is an integer; the shallow feature map is input to the first two-dimensional sparse processing module; the two-dimensional sparse processing module performs at least one channel sparse processing and at least one spatial sparse processing on the features of the input feature map, so as to obtain a processed deep feature map; each two-dimensional sparse processing module outputs a processed deep feature map, and the processed deep feature map output by the previous two-dimensional sparse processing module is input to the adjacent next two-dimensional sparse processing module to continue the two-dimensional sparse processing; based on the shallow feature map and the N processed deep feature maps, a two-dimensional sparse feature map is obtained.

[0113] The image super-resolution apparatus 900 based on non-local sparse attention may be an image receiving device 2000 .

[0114] <Equipment Example 2>

[0115] Fig.10 It is a schematic diagram of the hardware structure of an image super-resolution device based on non-local sparse attention according to another embodiment.

[0116] like Fig.10 As shown, the image super-resolution device 100 based on non-local sparse attention includes a processor 1010 and a memory 1020, wherein the memory 1020 is used to store an executable computer program, and the processor 1010 is used to execute a method such as any of the above method embodiments under the control of the computer program.

[0117] The image super-resolution apparatus 100 based on non-local sparse attention may be an image receiving device 2000 .

[0118] Each module of the image super-resolution device 900 based on non-local sparse attention can be implemented by the processor 1010 in this embodiment executing a computer program stored in the memory 1020, or can be implemented by other structures, which is not limited here.

[0119] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0120] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0121] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0122] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0123] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0124] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0125] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0126] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0127] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. An image super-resolution method based on non-local sparse attention, characterized in that: The method comprises: Obtaining a compressed low-resolution image; Extracting shallow features of the low-resolution image to obtain a shallow feature map of the low-resolution image; Performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map; Fusing the two-dimensional sparse feature map with the shallow feature map to obtain a feature fusion map of the low-resolution image; The feature fusion image is convolved and up-sampled to obtain a super-resolution image.

2. The method according to claim 1, characterized in that The performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map includes: Through the dual-dimensional sparse processing module, the shallow feature map is subjected to at least one channel sparse processing and then spatial sparse processing to obtain a dual-dimensional sparse feature map after at least one processing; wherein the dual-dimensional sparse processing module includes at least one group of channel sparse networks and spatial sparse networks connected in series; the shallow feature map is input into the first channel sparse network; the channel sparse network performs channel sparse processing on the input feature map to obtain a channel sparse feature map, and the spatial sparse network of the same group performs spatial sparse processing on the channel sparse feature map to obtain a processed depth sparse feature map; each spatial sparse network outputs a processed depth sparse feature map, and the processed depth sparse feature map output by the spatial sparse network of the previous group is input into the channel sparse network of the adjacent subsequent group to continue the channel sparse processing.

3. The method according to claim 2, characterized in that The step of performing channel sparse processing on the input feature map to obtain a channel sparse feature map includes: Extracting non-local features of the input feature map to obtain a first reshaping matrix; Obtain an attention map according to the vector of the first reshaped matrix; According to a set screening mechanism, a set proportion of attention features are screened in the attention map; A channel sparse feature map is obtained according to the attention feature, the preset first activation function and the vector.

4. The method according to claim 2, characterized in that: The performing spatial sparse processing on the channel sparse feature map to obtain the processed depth sparse feature map includes: According to a set block rule, the channel sparse feature map is divided into multiple groups of blocks; Extracting local features of the plurality of groups of image blocks to obtain a second reshaping matrix; Obtaining an attention map according to the vector of the second reshaped matrix; A deep sparse feature map is obtained according to the attention map, the preset second activation function and the vector.

5. The method according to claim 2, characterized in that: After performing channel sparse processing on the input feature map to obtain a channel sparse feature map, the method further includes: The first high-frequency information in the channel sparse feature map is extracted by a first gated convolution feedforward network connected between the channel sparse network of the same group and the spatial sparse network of the same group; wherein the first high-frequency information is the image high-frequency information in the channel sparse feature map after channel sparse processing.

6. The method according to claim 5, characterized in that After performing spatial sparse processing on the channel sparse feature map to obtain the processed depth sparse feature map, the method further includes: Through the second gated convolution feedforward network connected between the channel sparse network of the latter group and the spatial sparse network of the former group, the second high-frequency information in the deep sparse feature map is extracted; wherein the second high-frequency information is the image high-frequency information in the deep sparse feature map after spatial sparse processing.

7. The method according to claim 5 or 6, characterized in that: Each gated convolutional feedforward network obtains the high-frequency information of the image by extracting the features of the input sparse network graph and the preset third activation function.

8. The method according to claim 1, characterized in that The performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map includes: The steps of performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map are performed once by N two-dimensional sparse processing modules connected in series, respectively, to obtain the N processed deep feature maps; wherein N ≥ 2 and is an integer; the shallow feature map is input to the first two-dimensional sparse processing module; the two-dimensional sparse processing module performs at least one channel sparse processing and at least one spatial sparse processing on the features of the input feature map to obtain a processed deep feature map; each two-dimensional sparse processing module outputs a processed deep feature map, and the processed deep feature map output by the previous two-dimensional sparse processing module is input to the adjacent next two-dimensional sparse processing module to continue the two-dimensional sparse processing; a two-dimensional sparse feature map is obtained according to the shallow feature map and the N processed deep feature maps.

9. An image super-resolution device based on non-local sparse attention, characterized in that: The device comprises: An image acquisition module, used for acquiring a compressed low-resolution image; A feature acquisition module, used to extract shallow features of the low-resolution image to obtain a shallow feature map of the low-resolution image; A feature processing module, used for performing at least one channel sparse processing and at least one spatial sparse processing on the shallow feature map to obtain a two-dimensional sparse feature map; A feature fusion module, used for fusing the two-dimensional sparse feature map with the shallow feature map to obtain a feature fusion map of the low-resolution image; The image acquisition module is used to perform convolution and up-sampling processing on the feature fusion image to obtain a super-resolution image.

10. An image super-resolution device based on non-local sparse attention, characterized in that: The invention comprises a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the method according to any one of claims 1 to 8.