王雪松(1974-), 女, 教授, 博士生导师, 从事机器学习及模式识别、人工智能等研究, E-mail:
晁杰(1995-), 男, 硕士生, 从事生成对抗网络的研究, E-mail:
程玉虎(1973-), 男, 教授, 博士生导师, 从事机器学习、模式识别与智能系统等研究, E-mail:
针对如何恢复重建后超分辨率图像的纹理细节问题, 提出基于自注意力生成对抗网络的图像超分辨率重建模型(SRAGAN). 在SRAGAN中, 基于自注意力机制和残差模块相结合的生成器用于将低分辨率图像变换为超分辨率图像, 基于深度卷积网络构成的判别器试图区分重建后的超分辨率图像和真实超分辨率图像间的差异. 在损失函数构造方面, 一方面利用Charbonnier内容损失函数来提高图像的重建精度, 另一方面使用预训练VGG网络激活前的特征值来计算感知损失以实现超分辨率图像的精确纹理细节重构. 实验结果表明, SRAGAN在峰值信噪比和结构相似度分数上均优于当前流行算法, 能够重构出更为真实和具有清晰纹理的图像.
Aiming at how to recover the texture details of the reconstructed super-resolution image, an image super-resolution reconstruction based on the self-attention generative adversarial network (SRAGAN) is proposed. In the SRAGAN, a generator based on a combination of the self-attention mechanism and the residual module is used to transform low-resolution into super-resolution images, while a discriminator based on the deep convolutional network tries to distinguish the difference between the reconstructed and real super-resolution images. In terms of loss function construction, on the one hand, the Charbonnier content loss function is used to improve the accuracy of image reconstruction; on the other hand, the eigenvalues before the activation layer in the pre-trained VGG network are used to calculate the perceptual loss to achieve accurate texture detail reconstruction of super-resolution images. Experiments show that the proposed SRAGAN is superior to the current popular algorithms in peak signal-to-noise ratio and structural similarity score, reconstructing more realistic images with clear textures.
图像的超分辨率重建问题是指从一个低分辨率图像估计出超分辨率图像, 它是一个极具挑战性的任务.在计算机视觉领域, 图像超分辨率重建一直受到极大的关注, 并且具有广泛的应用, 如医学成像[
随着图像像素放大倍数的增加, 图像超分辨率重建问题的不确定性变得尤为明显. 当前图像超分辨率重建算法主要是基于学习的方法, 包括邻域嵌入[
解决超分辨率问题的另一种深度网络模型, 是Ledig等[
针对上述问题, 提出一种基于自注意力生成对抗网络的图像超分辨率重建算法(image super-resolution reconstruction based on self-attention GAN, SRAGAN), 通过设计带有自注意力机制残差模块的深层生成器结构, 利用自注意力层提取的全局特征信息进行超分辨率图像的重建. 生成器采用不同尺寸的卷积核进行输入图像的特征提取和超分辨率图像的特征重构, 不同大小的卷积核可以多方面地捕获图像的特征信息. 生成器中采用实例归一化层替代传统的批量归一化层, 对单个图像实例进行归一化处理, 更有助于解决图像重建任务. 在损失函数方面, 采用Charbonnier损失作为内容损失函数来评估所生成的图像与真实图像之间的相似性, 提供更强大的监督能力, 进而提高图像的重建精度. 同时, SRAGAN使用预训练好的VGG-19网络激活前的特征值来计算感知损失, 以实现超分辨率图像的精确纹理细节重构. 最后, 训练过程中使用Wasserstein距离来优化GAN网络的对抗训练, 以保证模型训练的收敛性.
给定低分辨率图像
通过优化训练样本上的
其中:
为解决图像超分辨率重建问题, 需要训练出生成器网络G和判别器网络D. 系统总框架由生成器和判别器组成, 生成器试图将低分辨率图像变换为真实的超分辨率图像, 判别器试图区分重建后的超分辨率图像和真实超分辨率图像的差异, 总体模型框图如
SRAGAN模型
在这项工作中, 最终目标是训练一个生成器网络, 使其生成与真实超分辨率图像尽可能相似的超分辨率图像. 为了实现这一点, 引入自注意力层, 设计自注意力机制残差模块, 它可以更好地利用全局特征信息进行超分辨率图像的重建. 在深度网络结构基础上, SRAGAN在生成器中将传统的批量归一化层替换为实例归一化层. 另外, 通过优化内容损失, 进一步评估所生成的图像与真实图像之间的相似性, 同时将感知损失进行优化, 使用VGG-19网络激活前的特征值来计算感知损失, 后面的章节会分别介绍损失函数.
最近几年, 注意力模型在深度学习各个领域得到了广泛的应用[
如
自注意力层原理图
其中:
其中:
虽然批量归一化已被证明在许多图像分类任务中是有效的, 但是这种归一化方法在一定程度上会降低图像生成任务的性能. 在图像风格转换任务中, 使用实例归一化代替批量归一化, 可以很好地实现图像转换的效果. 为此, 将生成器中的批处理规范化层替换为实例规范化层, 以提高图像超分辨率重建任务的性能. 实例归一化是将归一化应用到单个图像上, 有利于单个图像实例的生成. 设
其中:
为重建出具有清晰纹理的超分辨率图像, SRAGAN在损失函数中引入对抗损失, 通过生成器网络重建出的超分辨率图像尽可能去欺骗判别器网络, 以更加接近真实超分辨率图像. GAN的对抗性损失为
其中:
基于所有样本的生成器损失
为衡量网络重建出的超分辨率图像与真实超分辨率图像之间的相似程度, 通常是将相应模型重建的超分辨率图像与真实超分辨率图像以像素为单位计算其均方误差损失函数, 该评价方式在一定程度上削弱了模型的泛化能力, 使其仅局限于像素级信息的重建. 感知损失是在预训练的深度网络的激活层上定义的, 通过激活后的特征值来计算相应的损失函数, 可以使网络学习到更鲁棒的效果. 但是在比较深的网络之中, 激活后的特征会变得非常稀疏, 导致监督能力比较差, 所以SRAGAN采用激活前的特征值来计算感知损失. 激活前的特征可以更好地表示图像的特征信息, 它可以很好地监督重建后的图像与原图像的纹理一致性.
采用训练好的VGG-19网络来获得相应激活层前的特征值, 再通过计算生成的超分辨率图像特征图和原图像特征图之间的欧氏距离得到感知损失
其中
为了保证生成的超分辨率图像和原图像在内容上不会有较大的偏差, 模型中还需要加入内容损失函数. SRAGAN采用Charbonnier损失[
其中:
其中
训练时, 生成器主要任务是生成与真实超分辨率图像尽可能相似的超分辨率图像, 判别器则试图区分重建后的超分辨率图像和真实超分辨率图像的差异. 生成器网络主要由3部分组成, 分别是多卷积核下采样模块、自注意力残差模块和上采样图像重建模块. 如
生成器网络具体参数结构
判别器网络具体参数结构
输入: 训练样本为配对的图像训练集
step 1: 将
step 2: 计算
step 3: 根据MSE更新生成器, 迭代
step 4: 将
step 5: 将
step 6: 将
step 7: 计算
step 8: 计算总损失
step 9: 迭代step 4到step 8, 总共
输出: 生成器网络
实验使用DIV2K和RAISE作为训练数据集, 其中DIV2K包含800张超分辨率图像和对应的经过双三次插值处理过的低分辨率图像, RAISE数据集包含8 156张通过高质量照相机捕获的超分辨率图像和对应的低分辨率图像. 测试集采用3个广泛使用的基准标记数据集set5, set14和BSD100, 除此之外还使用valid数据集进行测试. 所有的实验均在低分辨率图像和超分辨率图像之间以4倍的比例因子进行, 这相当于图像像素增加了16倍. 为公平而言, 实验采用在超分辨率图像重建问题中使用最为广泛的峰值信噪比(PSNR)和图像结构相似度(SSIM)进行实验效果衡量. 对比方法包括Bicubic、SRCNN[
对于每个超分辨率图像裁剪出
模型训练完成后, 对测试数据集中的低分辨率图像进行超分辨率重建,
图像超分辨率重建模型量化结果比较
算法 | Bicubic | SRCNN[ |
FSRCNN[ |
SelfExSR[ |
LapSRN[ |
SRGAN[ |
SRAGAN | |
set 5 | PSNR | 28.42 | 30.49 | 30.71 | 30.33 | 31.54 | 29.41 | |
SSIM | 0.81 | 0.862 | 0.865 | 0.861 | 0.885 | 0.847 | ||
set 14 | PSNR | 26.1 | 27.61 | 27.7 | 27.54 | 26.2 | 28.12 | |
SSIM | 0.704 | 0.754 | 0.756 | 0.756 | 0.772 | 0.74 | ||
BSD100 | PSNR | 25.96 | 26.91 | 26.79 | 26.84 | 25.16 | 26.82 | |
SSIM | 0.669 | 0.712 | 0.714 | 0.712 | 0.728 | 0.669 | ||
vaild | PSNR | 28.55 | 30.12 | 30.52 | 30.23 | 31.32 | 30.96 | |
SSIM | 0.708 | 0.732 | 0.746 | 0.768 | 0.845 | 0.804 |
纹理细节的精确重建一直都是图像超分辨率重建问题的难点, 因为通过峰值信噪比衡量出来的图像结果往往与人眼视觉感知的图像结果不同, 过于平滑的图像无法反映真实图像的纹理细节. 在实验结果中, 选取set 5、set 14和BSD100数据集中的部分重建图像, 并把部分纹理细节放大, 对比实验结果, 可以清楚地看到通过SRAGAN重建后的超分辨率图像具有更清晰的纹理细节.
在
局部纹理细节比较(set 5数据集)
局部纹理细节比较(set 14数据集)
局部纹理细节比较(BSD100数据集)
在valid数据集上, 从实验结果中选取一张具有代表性的重建后古堡超分辨率图像, 并比较不同位置的局部纹理细节, 如
局部纹理细节对比(vaild数据集)
与SRCNN相比, 对抗损失的加入可以产生更加真实的结果, 模型不再局限于单纯的像素损失, 而是生成更接近于人类视觉感知的高质量图像. 与SRGAN方法相比, 自注意力机制模块的引入, 可以很好地协调图像中每一个位置信息的关系, 同时利用图像的全局特征信息来生成更清晰的超分辨率图像. 另一方面, 由于实例归一化层是在单个图像实例上进行归一化的, 更有利于图像的生成任务. 此外, 感知损失通过使用VGG-19网络激活前的特征来约束, 可以更好地监督超分辨率图像的纹理恢复. 实验表明, 作为一种通用的图像超分辨率重建模型框架, SRAGAN可以重建出具有逼真纹理细节的超分辨率图像, 适用于解决各种低分辨率图像的清晰化, 例如人脸识别、医学成像和卫星成像等.
最后, 通过实验来进一步探索内容损失函数对算法性能的影响. 为了验证Charbonnier损失函数的效果, 实验中将
内容损失对比表
数据集 | 内容损失 | SSIM | 训练次数 |
set 5 | Charbinnier | 0.862 | 200 |
set 5 | $L_2$ | 0.854 | 200 |
vaild | Charbinnier | 0.823 | 200 |
vaild | $L_2$ | 0.805 | 200 |
本文提出一种基于自注意力生成对抗网络的图像超分辨率重建模型, 构建了自注意力机制残差模块, 通过设计深层生成器网络, 利用生成对抗网络进行更好的图像超分辨率重建. SRAGAN模型中使用Charbonnier损失函数代替传统的
Shi W Z, Caballero J, Ledig C, et al. Cardiac image super-resolution with global correspondence using multi-atlas patchmatch[C]. Proceedings of International Conference on Medical Image Computing and Computer-Assisted Intervention. Berlin: Springer Verlag, 2013: 9-16.
Thornton M W, Atkinson P M, Holland D A. Sub-pixel mapping of rural land cover objects from fine spatial resolution satellite sensor imagery using super-resolution pixel-swapping[J]. International Journal of Remote Sensing, 2006, 27(3): 473-491.
Bilgazyev E, Efraty B, Shah S K, et al. Improved face recognition using super-resolution[C]. Proceedings of IEEE International Joint Conference on Biometrics. Piscataway: IEEE Press, 2011: 1-7.
Chang H, Yeung D Y, Xiong Y M. Super-resolution through neighbor embedding[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2004: 1275-1282.
Timofte R, Vincent De Smet, Luc Van Gool. A+: Adjusted anchored neighborhood regression for fast super-resolution[C]. Proceedings of Asian Conference on Computer Vision. Berlin: Springer Verlag, 2014: 111-126.
吴成东, 卢紫微, 于晓升. 基于加权随机森林的图像超分辨率算法研究[J]. 控制与决策, 2019, 34(10): 2243-2248.
Wu C D, Lu Z W, Yu X S. Image super resolution reconstruction algorithm based on weighted random forest[J]. Control and Decision, 2019, 34(10): 2243-2248.
吕恩辉, 王雪松, 程玉虎. 基于反卷积特征提取的深度卷积神经网络学习[J]. 控制与决策, 2018, 33(3): 447-454.
Lv E H, Wang X S, Cheng Y H. Deep convolution neural network learning based on deconvolution feature extraction[J]. Control and Decision, 2018, 33(3): 447-454.
Dong C, Loy C C, He K, et al. Image super-resolution using deep convolutional networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2014, 38(2): 295-307.
Kim J, Lee J K, Lee K M. Accurate image super-resolution using very deep convolutional networks[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 1646-1654.
Kim J, Lee J K, Lee K M. Deeply-recursive convolutional network for image super-resolution[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 1637-1645.
Tai Y, Yang J, Liu X. Image super-resolution via deep recursive residual network[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 2790-2798.
Shi W, Caballero J, Huszár Ferenc, et al. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 1871-1883.
Chao D, Chen C L, Tang X. Accelerating the super-resolution convolutional neural network[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 391-407.
Lai W S, Huang J B, Ahuja N, et al. Deep laplacian pyramid networks for fast and accurate super- resolution[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 5835-5843.
Lim B, Son S, Kim H, et al. Enhanced deep residual networks for single image super-resolution[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 1132-1140.
Ledig C, Wang Z, Shi W, et al. Photo-realistic single image super-resolution using a generative adversarial network[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 105-114.
Goodfellow I J, Pouget-Abadie J, Mirza M, et al. Generative adversarial nets[C]. Proceedings of Annual Conference on Neural Information Processing Systems. New York: NIPS Press, 2014: 2672-2680.
王星, 杜伟, 陈吉, 等. 基于深度残差生成式对抗网络的样本生成方法[J]. 控制与决策, 2020, 35(8): 1887-1894.
Wang X, Du W, Chen J, et al. Sample generation based on residual generative adversarial network[J]. Control and Decision, 2020, 35(8): 1887-1894.
Zhu J Y, Park T, Isola P, et al. Unpaired image-to-image translation using cycle-consistent adversarial networks[C]. Proceedings of IEEE Conference on International Conference on Computer Vision. Piscataway: IEEE Press, 2017: 2242-2251.
Yeh R A, Chen C, Lim T Y, et al. Semantic image inpainting with deep generative models[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 6882-6890.
李旭, 姚春龙, 范丰龙, 等. 结合注意力机制的循环神经网络复述识别模型[J]. 控制与决策, 2021, 36(1): 152-158.
Li X, Yao C L, Fan F L, et al. Recurrent neural networks based paraphrase identification model combined with attention mechanism[J]. Control and Decision, 2021, 36(1): 152-158.
Liu X, Li K, Li K. Attentive semantic and perceptual faces completion using self-attention generative adversarial networks[J]. Neural Processing Letters, 2020: 51(1): 211-229.
Barron J T. A general and adaptive robust loss function[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 4331-4339.
He K, Zhang X, Ren S, et al. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2015: 1026-1034.
Huang J B, Singh A, Ahuja N. Single image super-resolution from transformed self-exemplars[C]. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2015: 5197-5206.