WO2024140109A1 - 一种图像超分方法及装置 - Google Patents

一种图像超分方法及装置 Download PDF

Info

Publication number
WO2024140109A1
WO2024140109A1 PCT/CN2023/137339 CN2023137339W WO2024140109A1 WO 2024140109 A1 WO2024140109 A1 WO 2024140109A1 CN 2023137339 W CN2023137339 W CN 2023137339W WO 2024140109 A1 WO2024140109 A1 WO 2024140109A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
image
super
resolved
attention
Prior art date
Application number
PCT/CN2023/137339
Other languages
English (en)
French (fr)
Inventor
董航
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2024140109A1 publication Critical patent/WO2024140109A1/zh

Links

Definitions

  • the present application relates to the field of image processing technology, and in particular to an image super-resolution method and device.
  • Image super-resolution technology is a technology that restores high-resolution images from low-resolution images. Since image super-resolution business has become a key business in image quality enhancement, image super-resolution technology is one of the current research hotspots in the field of image processing.
  • the mainstream image super-resolution model is the image super-resolution model based on the Convolutional Neural Network (CNN).
  • CNN Convolutional Neural Network
  • most image super-resolution models based on CNN use the stacking of residual blocks to construct the backbone network.
  • a very deep network structure is usually stacked, which makes the model parameter amount large, and it is easy to produce overfitting during the training process.
  • some unnatural artifacts and aliasing phenomena will be generated.
  • the relevant technology proposes to obtain a larger receptive field through spatial self-attention or channel self-attention.
  • the image super-resolution model including the spatial self-attention module has a huge amount of computation when realizing high-resolution images, and the running speed is very slow.
  • the image super-resolution model including the channel self-attention module processes high-resolution images at a high speed, it pays too little attention to local information, and the detailed texture is difficult to restore, and the super-resolution image is very blurry.
  • the present application provides an image super-resolution method and device for better restoring the texture details of an image while ensuring the speed of image super-resolution.
  • an embodiment of the present application provides an image super-resolution method, comprising:
  • the first image feature is processed through a channel attention network to obtain a second image feature; wherein the channel attention network includes multiple levels of local channel self-attention layers connected in series, any local channel self-attention layer is used to divide the input feature of the local channel self-attention layer into multiple first feature blocks, and the multiple first feature blocks are recalibrated based on the channel self-attention mechanism to obtain the second feature blocks corresponding to each first feature block, and the second feature blocks corresponding to each first feature block are merged to obtain a merged feature, and the output feature of the local channel self-attention layer is obtained according to the merged feature;
  • the channel attention network includes multiple levels of local channel self-attention layers connected in series, any local channel self-attention layer is used to divide the input feature of the local channel self-attention layer into multiple first feature blocks, and the multiple first feature blocks are recalibrated based on the channel self-attention mechanism to obtain the second feature blocks corresponding to each first feature block, and the second feature blocks corresponding to each first feature block are merged to obtain a merged feature, and the output
  • a super-resolved image corresponding to the image to be super-resolved is generated according to the second image feature and the image to be super-resolved.
  • the recalibrated features are subjected to an inverse flattening process to obtain a second feature block corresponding to the first feature block.
  • the acquiring of the channel attention matrix according to the first encoding feature and the second encoding feature includes:
  • the convolution kernel sizes of the first fully connected layer, the second fully connected layer, and the third fully connected layer are all different.
  • any local channel self-attention layer is also used to process the output features of the local channel self-attention layer through a feed-forward network FFN before outputting the output features of the local channel self-attention layer.
  • generating a super-resolution map corresponding to the image to be super-resolved according to the second image feature and the image to be super-resolved includes:
  • a super-resolved image corresponding to the image to be super-resolved is generated according to the up-sampled features and the image to be super-resolved.
  • generating a super-resolved image corresponding to the image to be super-resolved according to the up-sampled features and the image to be super-resolved includes:
  • the interpolation image and the up-sampled features are added and fused to obtain a super-resolved image corresponding to the image to be super-resolved.
  • the generating unit is specifically used to upsample the second image feature to obtain the upsampled feature; and generate a super-resolved image corresponding to the image to be super-resolved according to the upsampled feature and the image to be super-resolved.
  • the generating unit is specifically configured to upsample the second image feature by an upsampling method of pixel recombination.
  • an embodiment of the present application provides a computer program product.
  • the computer program product runs on a computer, the computer implements the image super-resolution method described in the first aspect or any optional implementation of the first aspect.
  • the image super-resolution method provided in the embodiment of the present application performs super-resolution on the image to be super-resolution
  • the first feature extraction is performed on the image to be super-resolution to obtain the first image feature
  • the first image feature is then processed by the channel attention network to obtain the second image feature
  • the super-resolution image corresponding to the image to be super-resolution is generated according to the second image feature and the image to be super-resolution. Since the embodiment of the present application obtains a larger receptive field based on the channel self-attention mechanism to realize image super-resolution, the computational complexity of the image super-resolution method provided in the embodiment of the present application will not be increased due to the increase in image resolution.
  • FIG1 is a flowchart of one of the steps of the image super-resolution method provided in an embodiment of the present application.
  • FIG8 is a fourth structural diagram of an image super-resolution network model provided in an embodiment of the present application.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
  • the words “first”, “second”, etc. are used to distinguish the same items or similar items with basically the same functions and effects.
  • the words “first”, “second”, etc. are not intended to limit the quantity and execution order.
  • the first image feature and the second image feature are only used to distinguish different features, rather than to limit the order of the features.
  • any local channel self-attention layer is used to divide the input features of the local channel self-attention layer into multiple first feature blocks, and the multiple first feature blocks are recalibrated based on the channel self-attention mechanism, and the second feature blocks corresponding to each first feature block are obtained, and the second feature blocks corresponding to each first feature block are merged to obtain the merged features, and the output features of the local channel self-attention layer are obtained according to the merged features.
  • Step a performing a transposition operation on the second coding feature to obtain a fourth coding feature.
  • Step b Obtain the channel attention matrix according to the first coding feature, the fourth coding feature and the normalized exponential function (Softmax function).
  • the first operation layer 46 is used to obtain the channel attention matrix AM according to the first coding feature Q, the fourth coding feature L and the normalized exponential function.
  • the second operation layer 47 is used to recalibrate the third coding feature according to the channel attention matrix to obtain the recalibrated feature AR;
  • the deflattening layer 48 is used to deflatten the recalibrated feature AR to obtain the second feature block B2 corresponding to the first feature block B1.
  • the functions of other functional modules in the image super-resolution model shown in Figure 4 are the same as those in the embodiment shown in Figure 2. To avoid redundancy, they are not described in detail here.
  • the local channel self-attention layer can recalibrate the first feature block based on the channel information within the first feature block, effectively utilizing the channel information within the first feature block, but less utilizing the channel information between adjacent first feature blocks.
  • the embodiment of the present application further processes the merged feature through a feedforward network. Therefore, the embodiment of the present application can further capture the channel information between adjacent first feature blocks through a feedforward network, and then more effectively utilize the channel information between adjacent first feature blocks of the first image feature for image restoration. Therefore, the embodiment of the present application can better restore the texture details of the image to be super-resolved.
  • the following steps S502 to S510 are executed in a loop, and the output feature obtained in the last loop is used as the second image feature.
  • S512 Generate a super-resolved image corresponding to the image to be super-resolved according to the up-sampled features and the image to be super-resolved.
  • the feedforward network 2241 is used to process the merged feature F add to obtain the feedforward feature F ffn .
  • the feature fusion unit 2242 is used to generate the super-resolved image P out corresponding to the image to be super-resolved P in according to the feedforward feature F add.
  • the function of other functional modules in the image super-resolution model shown in FIG6 is the same as that of the embodiment shown in FIG4 , and will not be described in detail here to avoid redundancy.
  • S701 Perform convolution processing on the image to be super-resolved to obtain the first image feature.
  • S708 Merge the second feature blocks corresponding to the first feature blocks to obtain a merged feature.
  • the second feature blocks corresponding to the first feature blocks are merged into an image feature having the same dimension as the first image feature.
  • S709 Process the combined features through a feedforward network to obtain feedforward features.
  • the above steps S702 to S710 are executed in a loop, and the output features obtained in the last loop are used as the second image features.
  • S712 Perform linear interpolation on the image to be super-resolved to obtain an interpolated image.
  • performing linear interpolation on the image to be super-resolved to obtain an interpolated image includes:
  • the image generation module 23 in the image super-resolution model for implementing the image super-resolution method shown in FIG7 further includes: an image difference layer 233.
  • the image difference layer 233 is used to perform linear interpolation on the image to be super-resolution P in to obtain an interpolated image P U
  • the image reconstruction layer 232 is specifically used to perform addition fusion on the interpolated image P U and the up-sampled feature F u to obtain a super-resolution image P out corresponding to the image to be super-resolution P in .
  • the functions of other functional modules in the image super-resolution model shown in FIG8 are the same as those in the embodiment shown in FIG6 , and will not be described in detail here to avoid redundancy.
  • an embodiment of the present application also provides an image super-resolution device, and the device embodiment corresponds to the aforementioned method embodiment.
  • the present device embodiment will no longer repeat the details of the aforementioned method embodiment one by one, but it should be clear that the image super-resolution device in this embodiment can correspond to all the contents in the aforementioned method embodiment.
  • FIG9 is a schematic diagram of the structure of the image super-resolution device.
  • the image super-resolution device 900 includes:
  • An extraction unit 91 is used to perform feature extraction on the image to be super-resolved to obtain a first image feature
  • a calibration unit 92 is used to process the first image feature through a channel attention network to obtain a second image feature; wherein the channel attention network includes a plurality of local channel self-attention layers connected in series, any local channel self-attention layer is used to divide the input feature of the local channel self-attention layer into a plurality of first feature blocks, and recalibrate the plurality of first feature blocks based on the channel self-attention mechanism to obtain a second feature block corresponding to each first feature block, merge the second feature blocks corresponding to each first feature block to obtain a merged feature, and obtain the output feature of the local channel self-attention layer according to the merged feature;
  • the channel attention network includes a plurality of local channel self-attention layers connected in series, any local channel self-attention layer is used to divide the input feature of the local channel self-attention layer into a plurality of first feature blocks, and recalibrate the plurality of first feature blocks based on the channel self-attention mechanism to obtain a second feature block corresponding to each first feature block, merge the second feature blocks corresponding
  • the generating unit 93 is configured to generate a super-resolved image corresponding to the image to be super-resolved according to the second image feature and the image to be super-resolved.
  • the calibration unit 92 is specifically used to perform a transposition operation on the second coding feature to obtain a fourth coding feature; and obtain the channel attention matrix according to the first coding feature, the fourth coding feature and a normalized exponential function.
  • the convolution kernel sizes of the first fully connected layer, the second fully connected layer, and the third fully connected layer are all different.
  • the generating unit 93 is specifically used to upsample the second image feature to obtain the upsampled feature; and generate a super-resolved image corresponding to the image to be super-resolved according to the upsampled feature and the image to be super-resolved.
  • the generating unit 93 is specifically configured to upsample the second image feature by an upsampling method of pixel recombination.
  • the generating unit 93 is specifically used to perform linear interpolation on the image to be super-resolved to obtain an interpolated image; and perform addition and fusion of the interpolated image and the up-sampled features to obtain a super-resolved image corresponding to the image to be super-resolved.
  • the extraction unit 91 is specifically used to perform convolution processing on the image to be super-resolved to obtain the first image feature.
  • the image super-resolution device provided in this embodiment can execute the image super-resolution method provided in the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
  • FIG10 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application.
  • the electronic device provided by the present embodiment includes: a memory 101 and a processor 102, wherein the memory 101 is used to store a computer program; and the processor 102 is used to execute the image super-resolution method provided by the above embodiment when calling the computer program.
  • an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored.
  • the computer program is executed by a processor, the computing device implements the image super-resolution method provided in the above embodiment.
  • an embodiment of the present application further provides a computer program product.
  • the computing device implements the image super-resolution method provided in the above embodiment.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes.
  • Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer readable media include permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, which can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory

Abstract

本申请实施例提供了一种图像超分方法及装置,涉及图像处理技术领域。该方法包括:对待超分图像进行特征提取获取第一图像特征;通过通道注意力网络对第一图像特征进行处理获取第二图像特征;通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对多个第一特征块进行重标定获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据合并特征获取输出特征;根据第二图像特征和待超分图像生成待超分图像对应的超分图像。本申请实施例用于在保证图像超分的速度的同时较好的恢复图像的纹理细节。

Description

一种图像超分方法及装置
相关申请的交叉引用
本申请是以申请号为202211699926.5、申请日为2022年12月28日的中国专利申请为基础,并且主张其优先权,该中国专利申请的公开内容在此作为整体引入本申请中。
技术领域
本申请涉及图像处理技术领域,尤其涉及一种图像超分方法及装置。
背景技术
图像超分技术是一种由低分辨率图像恢复出高分辨率图像的技术。由于图像超分辨率业务目前已成为图像画质增强中的重点业务,因此图像超分技术是当前图像处理领域的研究热点之一。
目前,主流的图像超分模型为基于卷积神经网络(Convolutional Neural Network,CNN)的图像超分模型。然而,基于CNN的图像超分模型大多采用残差块的堆叠来构建主干网络,为了在特征提取过程中获取较大的感受野,通常会堆叠很深的网络结构,这使得模型参数量较大,训练过程中容易产生过拟合的现象,同时还会产生一些不自然的伪像与混叠现象。为了解决CNN模型参数量较大的问题,相关技术中提出了通过空间自注意力或通道自注意力来获取较大的感受野。然而,由于空间自注意力的计算量与图像分辨率成次指数关系,因此包括空间自注意力模块的图像超分模型在实现高分辨率图像时的运算量极大,运行速度很慢。包括通道自注意力模块的图像超分模型虽然高速的处理高分辨率图像,但对局部信息关注太少,细节纹理很难恢复,超分得到的图像十分模糊。
发明内容
有鉴于此,本申请提供了一种图像超分方法及装置,用于在保证图像超分的速度的同时较好的恢复图像的纹理细节。
为了实现上述目的,本申请实施例提供技术方案如下:
第一方面,本申请的实施例提供了一种图像超分方法,包括:
对待超分图像进行特征提取,获取第一图像特征;
通过通道注意力网络对所述第一图像特征进行处理,获取第二图像特征;其中,所述通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征;
根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,包括:
将所述第一特征块扁平化为二维特征,获取扁平化特征;
分别通过第一全连接层、第二全连接层以及第三全连接层对所述扁平化特征进行编码,获取第一编码特征、第二编码特征以及第三编码特征;
根据所述第一编码特征和第二编码特征,获取通道注意力矩阵;
根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征;
对所述重标定特征进行反扁平化处理,以获取所述第一特征块对应的第二特征块。
作为本申请实施例一种可选的实施方式,所述根据所述第一编码特征和第二编码特征获取通道注意力矩阵,包括:
对所述第二编码特征进行转置操作,获取第四编码特征;
根据所述第一编码特征、所述第四编码特征以及归一化指数函数获取所述通道注意力矩阵。
作为本申请实施例一种可选的实施方式,所述第一全连接层、所述第二全连接层以及所述第三全连接层的卷积核尺寸均不同。
作为本申请实施例一种可选的实施方式,任一局部通道自注意力层还用于在输出该局部通道自注意力层的输出特征之前,通过前馈网络FFN对该局部通道自注意力层的输出特征进行处理。
作为本申请实施例一种可选的实施方式,所述根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图,包括:
对所述第二图像特征进行上采样,获取上采样特征;
根据所述上采样特征和所述待超分图像生成所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述对所述第二图像特征进行上采样,包括:
通过像素重组的上采样方式对所述第二图像特征进行上采样。
作为本申请实施例一种可选的实施方式,所述根据所述上采样特征和所述待超分图像生成所述待超分图像对应的超分图像,包括:
对所述待超分图像进行线性插值,获取插值图像;
对所述插值图像和所述上采样特征进行相加融合,以获取所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述对待超分图像进行特征提取,获取第一图像特征,包括:
对所述待超分图像进行卷积处理,以获取所述第一图像特征。
第二方面,本申请实施例提供了一种图像超分装置,包括:
提取单元,用于对待超分图像进行特征提取,获取第一图像特征;
标定单元,用于通过通道注意力网络对所述第一图像特征进行处理,获取第二图像特征;其中,所述通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征;
生成单元,用于根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述标定单元,具体用于将所述第一特征块扁平化为二维特征,获取扁平化特征;分别通过第一全连接层、第二全连接层以及第三全连接层对所述扁平化特征进行编码,获取第一编码特征、第二编码特征以及第三编码特征;根据所述第一编码特征和第二编码特征,获取通道注意力矩阵;根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征;对所述重标定特征进行反扁平化处理,以获取所述第一特征块对应的第二特征块。
作为本申请实施例一种可选的实施方式,所述标定单元,具体用于对所述第二编码特征进行转置操作,获取第四编码特征;根据所述第一编码特征、所述第四编码特征以及归 一化指数函数获取所述通道注意力矩阵。
作为本申请实施例一种可选的实施方式,所述第一全连接层、所述第二全连接层以及所述第三全连接层的卷积核尺寸均不同。
作为本申请实施例一种可选的实施方式,所述标定单元,具体用于,通过前馈网络FFN对所述合并特征进行处理获取前馈特征,根据所述前馈特征获取所述输出特征。
作为本申请实施例一种可选的实施方式,所述生成单元,具体用于对所述第二图像特征进行上采样,获取上采样特征;根据所述上采样特征和所述待超分图像生成所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述生成单元,具体用于通过像素重组的上采样方式对所述第二图像特征进行上采样。
作为本申请实施例一种可选的实施方式,所述生成单元,具体用于对所述待超分图像进行线性插值,获取插值图像;对所述插值图像和所述上采样特征进行相加融合,以获取所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述提取单元,具体用于对所述待超分图像进行卷积处理,以获取所述第一图像特征。
第三方面,本申请实施例提供了一种电子设备,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用计算机程序时,使得所述电子设备实现第一方面或第一方面任一种可选的实施方式所述的图像超分方法。
第四方面,本申请实施例提供一种计算机可读存储介质,当所述计算机程序被计算设备执行时,使得所述计算设备实现第一方面或第一方面任一种可选的实施方式所述的图像超分方法。
第五方面,本申请实施例提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机实现第一方面或第一方面任一种可选的实施方式所述的图像超分方法。
本申请实施例提供的图像超分方法在对待超分图像进行超分时,首先对待超分图像进行特征提取获取第一图像特征,然后通过通道注意力网络对所述第一图像特征进行处理,获取第二图像特征,再根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。由于本申请实施例是通过基于通道自注意力机制来获取较大的感受野,进而现实图像超分的,因此本申请实施例提供的图像超分方法的计算量不会因为图像分辨率增 大而指数增大,因此本申请实施例首先可以保证图像超分的速度。又因为本申请实施例的通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征,因此本申请实施例在基于通道自注意力机制对图像特征进行重标定时,可以更加有效的利用待超分图像的局部信息,进而较好的恢复待超分图像的纹理细节。综上,本申请实施例提供的图像超分方法可以在保证图像超分速度的同时较好的恢复图像的纹理细节。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。
为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的图像超分方法的步骤流程图之一;
图2为本申请实施例提供的图像超分网络模型的结构示意图之一;
图3为本申请实施例提供的图像超分方法的步骤流程图之二;
图4为本申请实施例提供的图像超分网络模型的结构示意图之二;
图5为本申请实施例提供的图像超分方法的步骤流程图之三;
图6为本申请实施例提供的图像超分网络模型的结构示意图之三
图7为本申请实施例提供的图像超分方法的步骤流程图之四;
图8为本申请实施例提供的图像超分网络模型的结构示意图之四;
图9为本申请实施例提供的图像超分装置的结构示意图;
图10为本申请实施例提供的电子设备的硬件结构示意图。
具体实施方式
为了能够更清楚地理解本申请的上述目的、特征和优点,下面将对本申请的方案进行进一步描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以 相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本申请,但本申请还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本申请的一部分实施例,而不是全部的实施例。
需要说明的是,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分,本领域技术人员可以理解“第一”、“第二”等字样并不是在对数量和执行次序进行限定。例如:第一图像特征和第二图像特征仅仅是为了区分不同的特征,而不是在对特征的顺序等进行限定。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。此外,在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。
本申请实施例提供了一种图像超分方法,参照图1所示,该图像超分方法包括如下步骤:
S11、对待超分图像进行特征提取,获取第一图像特征。
本申请实施例中的待超分图像是指想要得到的高分辨率图像所对应的低分辨率图像。待超分图像可以为任意分辨率、任意格式的图像。例如:待超分图像可以为分辨率为960*540的RGB图像。
本申请实施例中不限定对待超分图像进行特征提取的特征提取方式,以能够对待超分图像进行特征提取为准。
作为本申请实施例一种可选的实施例方式,上步骤S11(对待超分图像进行特征提取,获取第一图像特征)包括:
对所述待超分图像进行卷积处理,以获取所述第一图像特征。
示例性的,用于对所述待超分图像进行卷积处理的卷积层的卷积核的尺寸可以为3*3,步长可以为1。
在一些实施例中,所述第一图像特征的长度与所述待超分图像的长度相同,所述第一图像特征的宽度与所述待超分图像的宽度相同。即,设:所述待超分图像的维度为[C0,H,W], 则所述第一图像特征的维度为[C1,H,W]。
S12、通过通道注意力网络(Channel Attention Networks)对所述第一图像特征进行处理,获取第二图像特征。
其中,所述通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征。
具体的,由于通道注意力网络的多级局部通道自注意力层串接,且通道注意力网络的输入为第一图像特征,因此通道注意力网络的第1级局部通道自注意力层的输入特征为第一图像特征,而第2级局部通道自注意力层以及后续局部通道自注意力层的输入特征均为上一级通道注意力层的输出特征。即,
其中,Inputn为第n级通道注意力层的输入特征,Outputn-1为第n-1级通道注意力层的输出特征。
在一些实施例中,所述局部通道自注意力层分割其输入特征得到的多个第一特征块的维度相同。即,所述局部通道自注意力层将其输入特征分割为多个维度相同的第一特征块。
在一些实施例中,所述多个第一特征块中的各个第一特征块的特征通道数量与所述第一图像特征的特征通道数量相同。即,设:所述第一图像特征的维度为[C1,H,W],则所述第一特征块的维度为[C1,p,p];且第一特征块的数量N=H/p×W/p。
由于局部通道自注意力层对输入特征的操作为:先将输入特征分割为多个第一特征块,再基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征,而基于通道自注意力机制分别对所述多个第一特征块进行重标定不会改变特征的维度,因此所述第二图像特征的维度与所述第一图像特征的维度相同。
S13、根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。
参照图2所示,参照图2中以通道注意力网络包括4级局部通道自注意力层为例示出。 如图2所示,用于实现图1所示图像超分方法的视频超分模型包括:特征提取模块21、通道注意力网络22以及图像生成模块23。
其中,特征提取模块21用于对待超分图像Pin进行特征提取获取第一图像特征F1。
通道注意力网络22包括:第1级局部通道自注意力层、第2级局部通道自注意力层、第3级局部通道自注意力层以及第4级局部通道自注意力层。第1级局部通道自注意力层的输入特征为第一图像特征F1,第2级局部通道自注意力层的输入特征为第1级局部通道自注意力层的输出特征Output1,第3级局部通道自注意力层的输入特征为第2级局部通道自注意力层的输出特征Output2,第4级局部通道自注意力层的输入特征为第3级通道注意力网络的输出特征Output3,第4级局部通道自注意力层的输出特征为第二图像特征F2。任一级局部通道自注意力层包括:特征分割单元221、通道自注意力单元222、特征合并单元223以及特征处理单元224。特征分割单元221用于将输入特征Input分割为多个第一特征块B1,通道自注意力单元222用于基于通道自注意力机制分别对所述多个第一特征块B1进行重标定,获取各个第一特征块B1对应的第二特征块B2,特征合并单元223用于合并各个第一特征块B1对应的第二特征块B2获取合并特征Fadd。特征处理单元224用于根据所述合并特征Fadd获取局部通道自注意力层的输出特征Output。
图像生成模块23用于根据所述第二图像特征F2和所述待超分图像Pin生成所述待超分图像Pin对应的超分图像Pout
本申请实施例提供的图像超分方法在对待超分图像进行超分时,首先对待超分图像进行特征提取获取第一图像特征,然后通过通道注意力网络对所述第一图像特征进行处理,获取第二图像特征,再根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。由于本申请实施例是通过基于通道自注意力机制来获取较大的感受野,进而实现图像超分的,因此本申请实施例提供的图像超分方法的计算量不会因为图像分辨率增大而指数增大,因此本申请实施例首先可以保证图像超分的速度。又因为本申请实施例的通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征,因此本申请实施例在基于通道自注意力机制对图像特征进行重标定时,可以更加有效的利用待超分图像的局部信息,进而较好的恢复待超分图像的纹理细节。综上, 本申请实施例提供的图像超分方法可以在保证图像超分速度的同时较好的恢复图像的纹理细节。
作为对上述实施例的扩展和细化,本申请实施例提供了另一种图像超分方法,参照图3所示,该图像超分方法包括如下步骤S301至S310:
S301、对所述待超分图像进行卷积处理,以获取所述第一图像特征。
示例性的,用于对所述待超分图像进行卷积处理的卷积层的卷积核的尺寸可以为3*3,步长可以为1。
根据通道注意力网络包括的局部通道自注意力层的层数,循环执行如下步骤S302至S309:
S302、将输入特征分割多个第一特征块。
其中,第一次循环时,所述输入特征为所述第一图像特征,除第一次循环外,所述输入特征为上一次循环得到的输出特征。即,
其中,Inputn为第n次执行所述步骤S302时的所述输入特征,Outputn-1为第n-1次执行步骤S309得到的输出特征。
S303、将所述第一特征块扁平化(flatten)为二维特征,获取扁平化特征。
在一些实施例中,所述扁平化特征的长度为所述输入特征块的长度与宽度的乘积,所述扁平化特征的宽度为所述输入特征块的特征通道数。即,当输入特征块维度为[C1,p,p],则所述扁平化特征的维度为[p+,C1]。
S304、分别通过第一全连接层(Fully Connected Layer)、第二全连接层以及第三全连接层对所述扁平化特征进行编码,获取第一编码特征、第二编码特征以及第三编码特征。
在一些实施例中,所述第一全连接层,所述第二全连接层以及所述第三全连接层的卷积核尺寸均不同。
S305、根据所述第一编码特征和第二编码特征,获取通道注意力矩阵。
在一些实施例中,上步骤S305(根据所述第一编码特征和第二编码特征,获取通道注意力矩阵)的实现方式包括入下步骤a和步骤b。
步骤a、对所述第二编码特征进行转置操作,获取第四编码特征。
即,将第二编码特征的所有特征点绕着一条从第1行第1列特征点出发的、右下方45° 的射线作镜面反转。
示例性的,第二编码特征为K,第四编码特征为L,且
则,有:
步骤b、根据所述第一编码特征、所述第四编码特征以及归一化指数函数(Softmax函数)获取所述通道注意力矩阵。
设:通道注意力矩阵为AM,所述第一编码特征为Q,所述第二编码特征为K,则有:
其中,σ为归一化指数函数的常数参数。
S306、根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征。
在一些实施例中,根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征,包括:
计算所述第三编码特征与所述通道注意力矩阵的外积,以获取所述重标定特征。
设:通道注意力矩阵为AM,所述第三编码特征为V,所述重标定特征为AR,则有:
AR=V×AM
S307、对所述重标定特征进行反扁平化处理(unflatten),以获取所述第一特征块对应的第二特征块。
即,将所述重标定特征反扁平化(unflatten)为维度与所述第一特征块维度相同的第二特征块。
S308、合并各个第一特征块对应的第二特征块获取合并特征。
即,各个第一特征块对应的第二特征块合并为维度与所述第一图像特征维度相同的图像特征。
S309、根据所述合并特征获取输出特征。
根据通道注意力网络包括的局部通道自注意力层的层数,循环执行上述步骤S302至S309,并将最后一次循环得到的所述输出特征作为所述第二图像特征。
S310、根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。
示例性的,参照图4所示,在图2所示图像超分模型的基础上,用于实现图3所示图像超分方法的图像超分模型中,各个级局部通道自注意力层的通道自注意力单元222包括:扁平化层41、第一全连接层42、第二全连接层43、第三全连接层44以及特征转置层45、第一运算层46、第二运算层47以及反扁平化层48。其中,扁平化层41用于将输入通道自注意力单元222的第一特征块B1扁平化为扁平化特征F2D,并将扁平化特征F2D分别输入第一全连接层42、第二全连接层43以及第三全连接层44,第一全连接层42、第二全连接层43以及第三全连接层44用于对所述二维特征F2D进行编码,并分别获取第一编码特征Q、第二编码特征K以及第三编码特征V。特征转置层45用于对第二编码特征K进行转置操作以获取第四编码特征L。第一运算层46用于根据所述第一编码特征Q、所述第四编码特征L以及归一化指数函数获取所述通道注意力矩阵AM,第二运算层47用于根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征AR;反扁平化层48用于对重标定特征AR进行反扁平化处理(unflatten),以获取所述第一特征块B1对应的第二特征块B2。图4所示图像超分模型中其它功能模块的作用与图2所示实施例相同,为避免赘述,此处不再详细说明。
作为对上述实施例的扩展和细化,本申请实施例提供了另一种图像超分方法,参照图5所示,该图像超分方法包括如下步骤S501至S512:
S501、对所述待超分图像进行卷积处理,以获取所述第一图像特征。
根据通道注意力网络包括的局部通道自注意力层的层数,重复执行如下步骤S502至S510:
S502、将输入特征分割多个第一特征块。
其中,第一次循环中执行步骤S502时,所述输入特征为所述第一图像特征,除第一次循环外,其它循环中执行步骤S502时,所述输入特征为上一次循环得到的输出特征。
S503、将所述第一特征块扁平化为二维特征,获取扁平化特征。
S504、分别通过第一全连接层、第二全连接层以及第三全连接层对所述扁平化特征进行编码,获取第一编码特征、第二编码特征以及第三编码特征。
在一些实施例中,所述第一全连接层,所述第二全连接层以及所述第三全连接层的卷积核尺寸均不同。
S505、根据所述第一编码特征和第二编码特征,获取通道注意力矩阵。
S506、根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征。
S507、对所述重标定特征进行反扁平化处理,以获取所述第一特征块对应的第二特征块。
即,将所述重标定特征反扁平化为维度与所述第一特征块维度相同的第二特征块。
S508、合并各个第一特征块对应的第二特征块获取合并特征。
即,各个第一特征块对应的第二特征块合并为维度与所述第一图像特征维度相同的图像特征。
S509、通过前馈网络(Feed Forward Networks,FFN)对所述合并特征进行处理,获取前馈特征。
前述步骤S502至步骤S508中,局部通道自注意力层可以基于第一特征块内部的通道信息对第一特征块进行重标定,有效利用了第一特征块内的通道信息,但对于相邻第一特征块间的通道信息利用较少,本申请实施例在合并各个第一特征块对应的第二特征块获取合并特征后,进一步通过前馈网络对所述合并特征进行处理,因此本申请实施例可以进一步通过前馈网络来捕捉相邻第一特征块间的通道信息,进而更加有效的利用第一图像特征相邻第一特征块间的通道信息进行图像恢复,因此本申请实施例可以更好的恢复待超分图像的纹理细节。
S510、根据所述前馈特征获取输出特征。
根据通道注意力网络包括的局部通道自注意力层的层数,循环执行如下步骤S502至S510,并将最后一次循环得到的输出特征作为所述第二图像特征。
S511、对所述第二图像特征进行上采样,获取上采样特征。
在一些实施例中,上述步骤S511(对所述第二图像特征进行上采样,获取上采样特征),包括:
通过像素重组(Pixel Shuffle)的上采样方式对所述第二图像特征进行上采样。
S512、根据所述上采样特征和所述待超分图像生成所述待超分图像对应的超分图像。
示例性的,参照图6所示,在图4所示图像超分模型的基础上,用于实现图5所示图像超分方法的图像超分模型中的图像生成模块23包括:上采样层231和图像重建层232。上采样层231用于对第二图像特征F2进行上采样,以获取上采样特征Fu,图像重建层232用于根据所述上采样特征Fu和所述待超分图像Pin生成所述待超分图像Pin对应的超分图像Pout。特征处理单元224包括:前馈网络2241和特征融合单元2242。前馈网络2241用于对所述合并特征Fadd进行处理获取前馈特征Fffn。特征融合单元2242用于根据所述前馈 特征Fffn获取输出特征Output。图6所示图像超分模型中其它功能模块的作用与图4所示实施例相同,为避免赘述,此处不再详细说明。
作为对上述实施例的扩展和细化,本申请实施例提供了另一种图像超分方法,参照图7所示,该图像超分方法包括如下步骤S701至S713:
S701、对所述待超分图像进行卷积处理,以获取所述第一图像特征。
针对所述第一图像特征,根据通道注意力网络包括的局部通道自注意力层的数量,循环执行如下步骤S702至S710:
S702、将输入特征分割多个第一特征块。
其中,第一次循环中执行步骤S702时,所述输入特征为所述第一图像特征,除第一次循环外,其它循环中执行步骤S702时,所述输入特征为上一次循环得到的输出特征。
S703、将所述第一特征块扁平化为二维特征,获取扁平化特征。
S704、分别通过第一全连接层、第二全连接层以及第三全连接层对所述扁平化特征进行编码,获取第一编码特征、第二编码特征以及第三编码特征。
S705、根据所述第一编码特征和第二编码特征,获取通道注意力矩阵。
S706、根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征。
S707、对所述重标定特征进行反扁平化处理,以获取所述第一特征块对应的第二特征块。
即,将所述重标定特征反扁平化为维度与所述第一特征块维度相同的第二特征块。
S708、合并各个第一特征块对应的第二特征块,获取合并特征。
即,各个第一特征块对应的第二特征块合并为维度与所述第一图像特征维度相同的图像特征。
S709、通过前馈网络对所述合并特征进行处理,获取前馈特征。
S710、根据所述前馈特征获取输出特征。
根据通道注意力网络包括的局部通道自注意力层的层数,循环执行上述步骤S702至S710,并将最后一次循环得到的输出特征作为所述第二图像特征。
S711、对所述第二图像特征进行上采样,获取上采样特征。
S712、对所述待超分图像进行线性插值,获取插值图像。
在一些实施例中,对所述待超分图像进行线性插值,获取插值图像,包括:
对所述待超分图像进行双线性插值,以获取插值图像。
S713、对所述插值图像和所述上采样特征进行相加融合,以获取所述待超分图像对应的超分图像。
示例性的,参照图8所示,在图6所示图像超分模型的基础上,用于实现图7所示图像超分方法的图像超分模型中的图像生成模块23还包括:图像差值层233。所述图像差值层233用于对所述待超分图像Pin进行线性插值,获取插值图像PU,所述图像重建层232具体用于对所述插值图像PU和所述上采样特征Fu进行相加融合,以获取所述待超分图像Pin对应的超分图像Pout。图8所示图像超分模型中其它功能模块的作用与图6所示实施例相同,为避免赘述,此处不再详细说明。
基于同一发明构思,作为对上述方法的实现,本申请实施例还提供了一种图像超分装置,该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的图像超分装置能够对应实现前述方法实施例中的全部内容。
本申请实施例提供了一种图像超分装置,图9为该图像超分装置的结构示意图,如图9所示,该图像超分装置900包括:
提取单元91,用于对待超分图像进行特征提取,获取第一图像特征;
标定单元92,用于通过通道注意力网络对所述第一图像特征进行处理,获取第二图像特征;其中,所述通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征;
生成单元93,用于根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述标定单元92,具体用于将所述第一特征块扁平化为二维特征,获取扁平化特征;分别通过第一全连接层、第二全连接层以及第三全连接层对所述扁平化特征进行编码,获取第一编码特征、第二编码特征以及第三编码特征;根据所述第一编码特征和第二编码特征,获取通道注意力矩阵;根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征;对所述重标定特征进行反扁平化处理,以获取所述第一特征块对应的第二特征块。
作为本申请实施例一种可选的实施方式,所述标定单元92,具体用于对所述第二编码特征进行转置操作,获取第四编码特征;根据所述第一编码特征、所述第四编码特征以及归一化指数函数获取所述通道注意力矩阵。
作为本申请实施例一种可选的实施方式,所述第一全连接层、所述第二全连接层以及所述第三全连接层的卷积核尺寸均不同。
作为本申请实施例一种可选的实施方式,所述标定单元92,具体用于通过前馈网络FFN对所述合并特征进行处理,获取前馈特征;根据所述前馈特征获取所述输出特征。
作为本申请实施例一种可选的实施方式,所述生成单元93,具体用于对所述第二图像特征进行上采样,获取上采样特征;根据所述上采样特征和所述待超分图像生成所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述生成单元93,具体用于通过像素重组的上采样方式对所述第二图像特征进行上采样。
作为本申请实施例一种可选的实施方式,所述生成单元93,具体用于对所述待超分图像进行线性插值,获取插值图像;对所述插值图像和所述上采样特征进行相加融合,以获取所述待超分图像对应的超分图像。
作为本申请实施例一种可选的实施方式,所述提取单元91,具体用于对所述待超分图像进行卷积处理,以获取所述第一图像特征。
本实施例提供的图像超分装置可以执行上述方法实施例提供的图像超分方法,其实现原理与技术效果类似,此处不再赘述。
基于同一发明构思,本申请实施例还提供了一种电子设备。图10为本申请实施例提供的电子设备的结构示意图,如图10所示,本实施例提供的电子设备包括:存储器101和处理器102,所述存储器101用于存储计算机程序;所述处理器102用于在调用计算机程序时执行上述实施例提供的图像超分方法。
基于同一发明构思,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当计算机程序被处理器执行时,使得所述计算设备实现上述实施例提供的图像超分方法。
基于同一发明构思,本申请实施例还提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算设备实现上述实施例提供的图像超分方法。
本领域技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。 因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质上实施的计算机程序产品的形式。
处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动存储介质。存储介质可以由任何方法或技术来实现信息存储,信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。根据本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (14)

  1. 一种图像超分方法,包括:
    对待超分图像进行特征提取,获取第一图像特征;
    通过通道注意力网络对所述第一图像特征进行处理,获取第二图像特征;其中,所述通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征;
    根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。
  2. 根据权利要求1所述的方法,其中,所述基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,包括:
    将所述第一特征块扁平化为二维特征,获取扁平化特征;
    分别通过第一全连接层、第二全连接层以及第三全连接层对所述扁平化特征进行编码,获取第一编码特征、第二编码特征以及第三编码特征;
    根据所述第一编码特征和第二编码特征,获取通道注意力矩阵;
    根据所述通道注意力矩阵对所述第三编码特征进行重标定,获取重标定特征;
    对所述重标定特征进行反扁平化处理,以获取所述第一特征块对应的第二特征块。
  3. 根据权利要求2所述的方法,其中,所述根据所述第一编码特征和第二编码特征获取通道注意力矩阵,包括:
    对所述第二编码特征进行转置操作,获取第四编码特征;
    根据所述第一编码特征、所述第四编码特征以及归一化指数函数获取所述通道注意力矩阵。
  4. 根据权利要求2或3所述的方法,其中,所述第一全连接层、所述第二全连接层以及所述第三全连接层的卷积核尺寸均不同。
  5. 根据权利要求1-4中任一项所述的方法,其中,所述根据所述合并特征获取该局部通道自注意力层的输出特征,包括:
    通过前馈网络FFN对所述合并特征进行处理,获取前馈特征;
    根据所述前馈特征获取所述输出特征。
  6. 根据权利要求1-5中任一项所述的方法,其中,所述根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像,包括:
    对所述第二图像特征进行上采样,获取上采样特征;
    根据所述上采样特征和所述待超分图像生成所述待超分图像对应的超分图像。
  7. 根据权利要求6所述的方法,其中,所述对所述第二图像特征进行上采样,包括:
    通过像素重组的上采样方式对所述第二图像特征进行上采样。
  8. 根据权利要求6所述的方法,其中,所述根据所述上采样特征和所述待超分图像生成所述待超分图像对应的超分图像,包括:
    对所述待超分图像进行线性插值,获取插值图像;
    对所述插值图像和所述上采样特征进行相加融合,以获取所述待超分图像对应的超分图像。
  9. 根据权利要求1-8中任一项所述的方法,其中,所述对待超分图像进行特征提取,获取第一图像特征,包括:
    对所述待超分图像进行卷积处理,以获取所述第一图像特征。
  10. 一种图像超分装置,包括:
    提取单元,用于对待超分图像进行特征提取,获取第一图像特征;
    标定单元,用于通过通道注意力网络对所述第一图像特征进行处理,获取第二图像特征;其中,所述通道注意力网络包括多级串接的局部通道自注意力层,任一局部通道自注意力层用于将该局部通道自注意力层的输入特征分割为多个第一特征块,基于通道自注意力机制分别对所述多个第一特征块进行重标定,获取各个第一特征块对应的第二特征块,合并各个第一特征块对应的第二特征块获取合并特征,以及根据所述合并特征获取该局部通道自注意力层的输出特征;
    生成单元,用于根据所述第二图像特征和所述待超分图像生成所述待超分图像对应的超分图像。
  11. 一种电子设备,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用计算机程序时,使得所述电子设备实现根据权利要求1-9中任一项所述的图像超分方法。
  12. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,当所述计算机程序被计算设备执行时,使得所述计算设备实现根据权利要求1-9中任一项所述 的图像超分方法。
  13. 一种计算机程序,所述计算机程序包括指令,所述指令在由处理器执行时实现根据权利要求1-9中任一项所述的图像超分方法。
  14. 一种计算机程序产品,所述计算机程序产品包括指令,所述指令在由处理器执行时实现根据权利要求1-9中任一项所述的图像超分方法。
PCT/CN2023/137339 2022-12-28 2023-12-08 一种图像超分方法及装置 WO2024140109A1 (zh)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211699926.5 2022-12-28

Publications (1)

Publication Number Publication Date
WO2024140109A1 true WO2024140109A1 (zh) 2024-07-04

Family

ID=

Similar Documents

Publication Publication Date Title
JP7108061B2 (ja) 歪んだドキュメント画像の矯正方法及び装置
KR20220066945A (ko) 이미지 프로세싱 방법, 장치, 전자 디바이스 및 컴퓨터 판독가능 저장 매체
CN112396645B (zh) 一种基于卷积残差学习的单目图像深度估计方法和系统
KR20220124622A (ko) 이미지 압축 방법 및 이미지 압축 장치
CN111242846A (zh) 基于非局部增强网络的细粒度尺度图像超分辨率方法
Singla et al. A review on Single Image Super Resolution techniques using generative adversarial network
CN112119408A (zh) 获取画质增强网络的方法、图像画质增强方法、装置、可移动平台、相机及存储介质
CN110473151B (zh) 基于分区卷积和关联损失的双阶段图像补全方法及系统
CN113256504A (zh) 图像处理的方法和电子设备
WO2023185284A1 (zh) 视频处理方法和装置
CN112184587B (zh) 一种边缘数据增强模型、以及基于所述模型的高效边缘数据增强方法及系统
WO2023051335A1 (zh) 数据编码方法、数据解码方法以及数据处理装置
CN111294614B (zh) 用于数字图像、音频或视频数据处理的方法和设备
US20220114770A1 (en) Image Processing Method And Apparatus And Computer Program Product For The Same
CN116596764A (zh) 一种基于Transformer与卷积交互的轻量级图像超分辨率方法
CN111355965A (zh) 一种基于深度学习的图像压缩还原方法及装置
WO2024140109A1 (zh) 一种图像超分方法及装置
TW202409963A (zh) 生成高分辨率圖像的方法、裝置及計算機可讀介質
Mao et al. Methodology for efficient reconfigurable architecture of generative neural network
Wahed et al. A simplified parabolic interpolation based reversible data hiding scheme
CN118279146A (zh) 一种图像超分方法及装置
Haris et al. An efficient super resolution based on image dimensionality reduction using accumulative intensity gradient
CN114418882A (zh) 处理方法、训练方法、装置、电子设备及介质
CN118279144A (zh) 一种图像超分方法及装置
JP2021174404A (ja) データ生成装置、訓練装置及びデータ生成方法