Print

发布时间: 2018-12-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.180331
2018 | Volume 23 | Number 12




    图像处理和编码    




  <<上一篇 




  下一篇>> 





类别信息生成式对抗网络的单图超分辨重建
expand article info 杨云1, 张海宇1, 朱宇2, 张艳宁2
1. 陕西科技大学电气与信息工程学院, 西安 710021;
2. 西北工业大学计算机学院, 西安 710129

摘要

目的 基于生成式对抗网络的超分辨模型(SRGAN)以感知损失函数作为优化目标, 有效解决了传统基于均方误差(MSE)的损失函数导致重建图像模糊的问题。但是SRGAN的感知损失函数中并未添加明确指示模型生成对应特征的标志性信息, 使得其无法精准地将数据的具体维度与语义特征对应起来, 受此局限性影响, 模型对于生成图像的特征信息表示不足, 导致重建结果特征不明显, 给后续识别处理过程带来困难。针对上述问题, 在SRGAN方法的基础上, 提出一种类别信息生成式对抗网络的超分辨模型(class-info SRGAN)。方法 对SRGAN模型增设类别分类器, 并将类别损失项添加至生成网络损失中, 再利用反向传播训练更新网络参数权重, 以达到为模型提供特征类别信息的目的, 最终生成具有可识别特征的重建图像。创新及优势在于将特征类别信息引入损失函数, 改进了超分辨模型的优化目标, 使得重建结果的特征表示更加突出。结果 经CelebA数据集测试表明:添加性别分类器的class-info SRGAN的生成图像性别特征识别率整体偏高(58%~97%); 添加眼镜分类器的class-info SRGAN的生成图像眼镜框架更加清晰。此外, 模型在Fashion-mnist与Cifar-10数据集上的结果同样表明其相较于SRGAN的重建质量更佳。结论 实验结果验证了本方法在超分辨重建任务中的优势和有效性, 同时结果显示:虽然class-info SRGAN更适用于具有简单、具体属性特征的图像, 但总体而言仍是一种效果显著的超分辨模型。

关键词

SRGAN; 感知损失函数; MSE; 类别信息; class-info SRGAN

Class-information generative adversarial network for single image super-resolution
expand article info Yang Yun1, Zhang Haiyu1, Zhu Yu2, Zhang Yanning2
1. College of Electrical & Information Engineering, Shaanxi University of Science and Technology, Xi'an 710021, China;
2. School of Computer Science, Northwestern Polytechnical University, Xi'an 710129, China
Supported by: Young Scientists Fund of National Natural Science Foundation of China (61601271)

Abstract

Objective The use of image super-resolution reconstruction technology implies the utilization of a set of low-quality low-resolution images (or motion sequences) to produce the corresponding high-quality and high-resolution ones.This technology has a wide range of applications in many fields, such as military, medicine, public safety, and computer vision.In the field of computer vision, image super-resolution reconstruction enables the image to transform from the detection level to the recognition level, and even advance to the identification level.In other words, image super-resolution reconstruction can enhance image recognition capability and identification accuracy.In addition, image super-resolution reconstruction involves a dedicated analysis of a target.In this analytic scheme, a comparatively high spatial resolution image of the region of interest is obtained instead of directly calculating the configuration of a high spatial resolution image by using large amounts of data.The conventional approaches of super-resolution reconstruction generally include example-based model, bi-cubic interpolation model, and sparse coding methods, among others.Deep learning has been considered for many associative subjects since the advent of artificial intelligence in recent years, and substantial research achievements have been realized in this field alongside the research on super-resolution reconstruction.Convolutional neural networks (CNNs) and generative adversarial networks (GANs) have resulted in numerous breakthroughs and achievements in the domain of image super-resolution reconstruction.Examples include super-resolution reconstruction with CNN (SRCNN), super-resolution reconstruction with very-deep convolutional networks (VDSR), and super-resolution reconstruction with generative adversarial network (SRGAN).Particularly in SRGAN modeling, the single-image super-resolution technology has achieved remarkable progress, especially when the perceptual loss function instead of the traditional loss function based on the mean square error (MSE) is the optimization goal.The common problems during modeling can be effectively solved using the original loss function, and a relatively high peak signal-to-noise ratio (PSNR) can be obtained to resolve the fuzziness in the reconstruction results.However, even if super-resolution reconstruction can remarkably ameliorate image quality, a common problem is knowing how to comprehensively highlight the feature representation of reconstructed images, which then can improve the reconstruction quality of generated images.By itself, the method of super-resolution reconstruction causes an ill-posed problem; that is, images lose a certain amount of information during the down-sampling process.Therefore, the reconstruction of a high-resolution image may include the lost parts or characteristic of the corresponding low-resolution image, and this scenario inevitably leads to generative deviation.In addition, given that SRGAN does not add auxiliary trademark information into the loss function (i.e., the model should have been explicitly instructed to generate the corresponding features), the model may fail to accurately match the specific dimensions and semantic features of the data.Moreover, controllability will likely constrain the model from sufficiently representing the feature information of generated images, which then limits the model from improving the quality of reconstructed images.Such constraints pose difficulties to the subsequent identification and processing of the image.Aiming to solve the above problems, on the basis of the advantages of the SRGAN method, a super-resolution model based on the class-information generative adversarial network (class-info SRGAN) is proposed.Class-info SRGAN can be designed for the utilization of additional information variables to restrict the solution space scope of super-resolution reconstruction.Furthermore, class-info SRGAN can be used to assist the model to accurately fulfil the reconstruction task, particularly those referring to data semantic features. Method The original SRGAN model involves the adding of a class classifier and integrating the class-loss item into the generative network loss.Then, back-propagation is employed during the training process to update the parameter weights of the network and provide feature class-information for the model.Finally, the reconstructed images are produced and possessed with the corresponding features.In contrast to the original objective function, the proposed model is innovative given its merits of having to introduce feature class-information and improving the optimization objective of the super-resolution model.Sequentially, it optimizes the network training process, and it then renders the feature representation of the reconstruction results to become more prominent. Result According to the CelebA experiments, the class-loss item enables the SRGAN model to make minor changes and improve the output.A comparison of the SRGAN model with other models with gender-class information was conducted, and the differences were inconclusive, i.e., it is hard to conclude whether the model has a significant effect even if improvements were achieved to some extent.The overall gender recognition rate of the generated images from the class-info SRGAN model ranges from 58% to 97%, which is higher than the rate of those from SRGAN (8% to 98%).However, with glasses-class information, the capability of the model to learn how to form better-shaped glasses increased.The results for the Fashion-mnist dataset and Cifar-10 dataset also show that the model has a significant effect even if the final results with the Cifar-10 dataset were not highly prominent as the previous experiments.In summary, the outcomes show that the reconstruction quality of the generated images from the class-info SRGAN model are better than those of the original SRGAN model. Conclusion Class-information operates well in cases where the attributes are clear and the model has learned as much as possible.The experimental results verify the superiority and effectiveness of the proposed model in the super-resolution reconstruction task.On the basis of some concrete and simple feature attributes, class-info SRGAN will likely become a promising super-resolution model.However, to advance its application, the goals must be definite, e.g., how to develop a general class-info SRGAN that can be used for various super-resolution reconstruction tasks, how to successfully conduct class-info SRGAN with multiple attributes simultaneously, and how to integrate auxiliary class-information into the architectures of class-info SRGAN efficiently and conveniently.These assumptions can provide references and conditions for acquiring better performing super-resolution reconstruction in the future.

Key words

super-resolution based on generative adversarial network (SRGAN); perceptual loss function; Mean Square Error (MSE); class-info; class-info SRGAN

0 引言

单图超分辨(SISR)的主要任务是通过单幅低分辨率(LR)图像重建出高分辨率(HR)图像。由于单图超分辨的输入相比序列超分辨更易获得, 因此其应用前景十分广阔[1-2]

近年来, 将深度学习应用于超分辨重建任务成为发展的趋势, 随之衍生出许多著名的超分辨模型。其中, SRCNN[3](super-resolution based on convolutional neural network)是首个基于深度学习的超分辨模型。尽管SRCNN效果明显优于传统方法, 但仍存在对超参数变化敏感, 训练期间网络不稳定导致训练困难等问题有待改善。

随着Goodfellow等人[4]于2014年10月提出生成式对抗网络(GANs), Ledig等人[5]将其应用于超分辨重建领域并提出了SRGAN (super-resolution based on generative adversarial network)模型。该方法效果明显, 特别是在单图超分辨的2~4倍放大倍数方面作用显著, 超越了之前SRCNN[3]模型的重建结果。

其中, 值得注意的是SRGAN[5]模型改进了原始损失函数, 将感知损失函数(perceptual loss function)作为其优化目标, 从而有效地解决了传统的基于均方误差(MSE)损失函数的模型为了获得较高的峰值信噪比(PSNR)而导致重建图像模糊的问题。

但是, 超分辨重建本身属于一种病态问题(ill-posed problem), 该问题成立的基础是构建以先验知识将高分辨率图像映射成为低分辨率图像的观测模型(observation model)。由于图像降采样过程中一定量信息的损失, 因而再由采样获得的已丢失部分特征的低分辨率图像重建出对应的高分辨率图像必然会存在一定的生成偏差, 这种偏差随着图像内容、类别、纹理等复杂程度的提高而提高。

另一方面, SRGAN[5]模型的感知损失函数中并未添加明确指示模型生成对应特征的标志性信息, 造成超分辨重建的解不具有确定性, 从而使得模型无法精准地将数据的具体维度与语义特征对应起来。这种在可控性上受到的限制造成模型对于生成图像的特征信息无法进行充分地表示, 导致重建结果的局部特征不明显, 进而无法全面提升重建质量。

为了解决以上问题, 本文提出一种类别信息生成式对抗网络的超分辨模型(class-info SRGAN), 核心是改进以SRGAN[5]为基础的网络结构, 引入特征类别信息以突出重建结果的具体属性特征, 使其在目前较为成功的超分辨放大倍数上实现更为理想的重建效果。方法的理论基础是通过对SRGAN模型设法增添类别分类器, 引入类别损失项, 利用反向传播(back propagation)训练的方式更新网络参数权重以提供图像特征类别信息, 协助模型训练并生成具有可识别特征的重建图像。

class-info SRGAN模型的创新及优势之处在于, 将特征类别信息引入损失函数, 改进了原始SRGAN[5]模型的目标函数, 优化了网络训练过程, 使得重建结果的特征表示更加突出, 并为之后针对超分辨重建图像做进一步的检测、识别和分析等工作提供了重要的前提与保障。

1 相关工作

多年来, 有关超分辨重建的研究一直吸引着人们的目光, 其方法种类较多, 现大致将超分辨模型分为两类:非深度学习方法和深度学习方法。

1.1 非深度学习方法

传统的超分辨模型之一是基于实例的超分辨[6](example-based super-resolution), 其通过最近邻搜索[7]在三次样条插值[8]中锐化边缘和图像细节, 该方法可以获得丰富的高频信息, 但缺点也较为明显, 比如对于训练样本的要求较高, 以及对噪声极为敏感。

另一种模型是双立方插值超分辨[9](bicubic interpolation super-resolution), 其突出特点是在2倍放大倍数上效果理想, 并且成功改进了之前先进的双线性插值模型[10](bilinear interpolation model)。基于插值的方法通常算法简单、快速, 但却容易产生模糊或者锯齿边缘。

此外, 还有利用稀疏编码[11] (sparse coding)方法学习与优化低分辨率图像块映射函数, 并聚合相应的高分辨率图像块进行超分辨重建。但该方法的缺陷在于过完备词典[12](over-complete dictionary)的选择, 随机选取只能实现特定领域图像的超分辨, 而对于通用图像的超分辨重建效果较差。

一般来说, 非深度学习的超分辨重建模型由于受到抗噪能力、重建质量, 以及不同类型图像之间泛化程度的限制, 因此效果并不理想。

1.2 深度学习方法

SRCNN[3]是最早将深度学习技术应用于超分辨重建的神经网络模型, 其主要可分为3个步骤:图像块提取与特征表示, 特征非线性映射以及最终的重建。SRCNN在2倍放大倍数方面效果显著, 并启发了其他一些基于卷积神经网络(CNN)的方法, 主要包括像素递归超分辨[13](PRSR)和感知损失[14](perceptual loss)。

另一种基于卷积神经网络的方法是使用更深层的CNN模型, 即VDSR[15](super-resolution using very deep convolutional networks)。VDSR重复地级联一对卷积和非线性层, 深度范围为520, 并且随着网络深度的增加, 模型性能也有所提高。VDSR与SRCNN相比有了明显的改进, 特别是在更高放大倍数的情况下。

另外, 香港中文大学的Dong等人[16]在SRCNN[3]之后又提出了FSRCNN[16](fast super-resolution convolutional neural networks)。其主要从以下3个方面对SRCNN进行改进:1)FSRCNN不再将双立方插值作为输入, 而是采用原始低分辨率图像, 并在网络末端引入去卷积层以执行上采样; 2)SRCNN中的非线性映射被FSRCNN中的收缩、映射和扩展所替代; 3)FSRCNN采用更小的滤波器尺寸和更深的网络结构。这些改进在为FSRCNN提供了更好性能的同时也降低了计算成本。

上述基于CNN的超分辨重建模型虽然效果与传统方法相比有了大幅提升, 但是由于模型对超参数的变化较为敏感, 以及在训练期间网络不稳定导致训练困难等问题的存在, 给重建过程的顺利完成造成了阻碍。

在过去几年中, 使用GANs[4]实现超分辨重建已经取得了显著的进展。Radford等人[17]于2015年提出深度卷积生成式对抗网络[17](DCGAN)以提升训练GANs执行超分辨重建任务时的稳定性。还有一种重要的基于深度学习的超分辨模型即SRGAN[5]。Ledig等人[5]提出使用一种带有残差块(residual blocks)的前馈CNN网络作为其生成函数, 该函数使用感知损失作为优化目标。从本质上来说, SRGAN的主要特点是利用深度残差网络[18](DRN)使该模型能够实现4倍的放大倍数, 而且改进了基于原始目标函数的重建模型为获得较高的PSNR造成图像模糊的缺陷。目前来说, SRGAN模型被广泛认为能够产生当前最先进的重建效果。

但是, SRGAN[5]在超分辨重建过程中缺少显式添加的指示模型生成对应特征的类别信息, 这会导致重建结果的特征类别表征不明, 从而造成重建图像与原始图像存在一定的语义特征偏差, 甚至可能会重建出具有错误特征信息的图像。这对超分辨重建问题本身来说是至关重要的, 因为即使成功恢复了具有高质量清晰度的图像, 但是由于图像内容的错误会使得整个重建过程及结果的价值被大幅削减。本文提出的class-info SRGAN模型, 针对这一问题, 通过将特征类别信息引入损失函数, 从而改进了超分辨模型的优化目标, 使得最终重建结果的特征表示更加突出, 为后续的识别处理等相关工作奠定了良好的基础。

2 方法

2.1 GANs

生成式对抗网络[4](GANs)是一种通过对抗过程估计生成模型的网络框架, 其对生成模型(generative model)的发展产生了深远的影响。

GANs由生成网络$G$和判别网络$D$构成, $D$可以判断出样本是来自于原始数据还是由生成网络产生, 而$G$试图伪造原始数据来使判别模型做出错误判断, 直至生成真假难辨的样本。整个过程中$G$$D$同时运行, 可近似将其看做是一种二元博弈游戏(two-player minmax game)。GANs的原理示意图如图 1所示, 目标函数表示为

$ \begin{array}{l} \mathop {{\rm{min}}}\limits_G \;\mathop {{\rm{max}}}\limits_D \left( {D, G} \right) = \\ {{\mathbb{E}}_{x \sim {p_{{\rm{data}}}}}}\left( x \right)\left[{{\rm{log}}D\left( x \right)} \right] + {{\mathbb{E}}_{z \sim p}}_{{z_{\left( z \right)}}}\left[{{\rm{log}}\left( {1-D\left( {G\left( z \right)} \right)} \right)} \right] \end{array} $ (1)

式中, $z$是潜在表征, 初始化为随机噪声, $x$是真实样本, $p$代表概率分布, $\mathbb{E}$代表期望。

图 1 生成式对抗网络原理示意图
Fig. 1 GANs schematic diagram

2.2 SRGAN

随机噪声的输入使得GANs[4]在训练过程中显得过于自由, 这种在可控性方面的缺陷最终导致生成模型效果不佳。对此, SRGAN[5]不再使用随机噪声作为初始化变量, 而是将来自原始数据集的高分辨率图像${\mathit{\boldsymbol{I}}^{{\rm{HR}}}}$经高斯滤波降采样得到的低分辨率图像${\mathit{\boldsymbol{I}}^{{\rm{LR}}}}$作为训练样本。SRGAN的原理示意图如图 2所示, 其目标函数表示为

$ \begin{array}{l} \mathop {{\rm{min}}}\limits_{{\theta _G}} \;\mathop {{\rm{max}}}\limits_{{\theta _D}} {{\mathbb{E}}_{{I^{{\rm{HR}}}} \sim {p_{{\rm{train}}}}^{({I^{{\rm{HR}}}})}}}[{\rm{log}}{D_{{\theta _D}}}({I^{{\rm{HR}}}})] + \\ {{\mathbb{E}}_{{I^{{\rm{LR}}}} \sim {p_\mathit{G}}^{({I^{{\rm{LR}}}})}}}[{\rm{log}}(1-{D_\theta }_D({G_\theta }_G({I^{{\rm{LR}}}})))] \end{array} $ (2)

图 2 生成式对抗网络的超分辨原理示意图
Fig. 2 SRGAN schematic diagram

式中, 由${\theta _G}$参数化的前馈CNN生成网络记作${G_{{\theta _G}}}$, 这里, ${\theta _G} = \left\{ {{W_{1:L}};{b_{1:L}}} \right\}$, 表示$L$层深度网络的权重和偏差, 并通过优化超分辨重建的特定损失函数${l^{{\rm{SR}}}}$获得, 同理有参数化判别网络${D_{{\theta _D}}}$

SRGAN以感知损失作为优化目标, 该损失由内容损失(content loss)和对抗损失(adversarial loss)两部分加权组合构成, 即

$ {l^{{\rm{SR}}}} = l_X^{{\rm{SR}}} + {10^{-3}}\;l_{{\rm{Gen}}}^{{\rm{SR}}} $ (3)

式中, $l_X^{{\rm{SR}}}$是内容损失函数, 使用VGG(very deep convolutional networks)[19]网络特征图谱损失替代了之前基于MSE的内容损失, $l_{{\rm{Gen}}}^{{\rm{SR}}}$是原始对抗损失函数, 其中Gen代表生成网络。

2.3 class-info SRGAN

如前所述, SRGAN[5]的感知损失函数中缺少特征类别信息, 使得模型对于生成图像的特征信息表示不足, 导致重建结果的特征表示不明显甚至出现错误, 给后续相关工作造成障碍。

本文提出一种用于单图超分辨的class-info SRGAN模型。在该模型下, 设$C\left( * \right)$为计算类别损失的附加项, 通过对目标函数显式地添加并最小化该类别损失项从而对超分辨模型引入特征类别信息, 这样一方面改进了超分辨模型的目标函数, 优化了训练过程, 另一方面更突出了重建结果的特征表示。class-info SRGAN的原理示意图如图 3所示, 其目标函数表示为

$ \begin{array}{l} \mathop {{\rm{min}}}\limits_G \;\mathop {{\rm{max}}}\limits_D {{\mathbb{E}}_{{I^{{\rm{HR}}}} \sim {p_{{\rm{train}}}}^{({I^{{\rm{HR}}}})}}}[{\rm{log}}{D_{{\theta _D}}}({I^{{\rm{HR}}}})] + \\ {{\mathbb{E}}_{{I^{{\rm{LR}}}} \sim {p_\mathit{G}}^{({I^{{\rm{LR}}}})}}}[{\rm{log}}(1-{D_\theta }_D({G_\theta }_G({I^{{\rm{LR}}}}) + C\left( * \right)))] \end{array} $ (4)

图 3 类别信息生成式对抗网络的超分辨原理示意图
Fig. 3 Class-info SRGAN schematic diagram

为了实现该结构, 首先根据一组预先确定类别的属性(比如性别或眼镜等)在原始数据集上训练分类器, 具体参照3.2.1节所述。然后固定分类器权重并将网络结构导入SRGAN模型, 因此在模型训练期间不会再对分类器参数的权重进行更新。最后替换分类器中的节点, 将现有的SRGAN结构图与分类器结构图连接起来, 以便在SRGAN模型中使用附加的类别信息, 从而实现class-info SRGAN模型。

整个过程概括来说, 就是使用与SRGAN连接后的分类器模型首先得到原始高分辨率图像(64×64像素)的分数, 同理可得到生成器生成图像(64×64像素)的分数, 再将原始高分辨率图像分数视为标签, 生成器分数作为Softmax交叉熵损失的对数值, 产生的类别损失项然后被添加到生成器损失中并且使用Adam函数优化, 该方法类似于原始GANs模型中的损失函数最小化。

通过向生成器损失中添加分类器类别损失项, 使生成器针对分类器上的正确预测进行了优化, 从而显式地表明结果接近于原始图像, 而类别损失反推至生成器的参数权重, 使得分类器呈现生成器学到的附加信息, 例如一些性别特征或眼镜的样子等。因此, 类别损失项提供的信息对超分辨模型的训练过程和结果而言都是十分重要的。

3 实验

一般来说, 特别是当针对一些背景复杂、内容丰富的数据进行重建时, 类别信息可能不会对超分辨模型产生较为显著的影响。因为这些图像内包含的特征数量庞大, 细节信息繁多, 导致类别信息的添加与使用会变得复杂而困难。相比之下, 图像像素和边缘信息通常被认为对重建结果更为重要。

本文所述方法旨在从具体特征层面来增强单图超分辨的重建效果, 因此, 此处首先选择CelebA[20]作为训练与测试数据集, 理由是相较于其他数据集, CelebA的内容和背景较为单一, 故推测类别信息对其超分辨重建结果产生影响的可能性较大, 而且实验效果也会更加显著。

3.1 CelebA数据集

名人面孔特征数据集(CelebA)是一个大规模人脸特征数据集, 每个图像具有40个属性标签(如:“男”、“眼镜”、“刘海”、“胡子”等)。CelebA内容丰富, 总共包括10 177种身份, 202 599位名人人脸图像和5个地标位置。

CelebA提供数据集的预处理对齐和剪切版本, 这些对上半身进行了对齐和裁剪后的图像大小为178×218像素(例如图 4(a))。此处, 在原始图像脸部周围随机裁剪生成128×128像素大小的图像并缩小至64×64像素(例如图 4(b)), 最后使用经过4倍降采样的16×16像素的图像作为模型输入。

图 4 CelebA数据集样本图像
Fig. 4 CelebA dataset sample image ((a) aligned and cropped image (178×218 pixels); (b) preprocessed and cropped image (64×64 pixels))

3.2 类别信息

此处旨在以原始SRGAN模型重建质量为基础的前提下提高人眼对特定属性的辨别度。比如下文中通过添加性别信息, 希望在生成图像中使该特征更加突出, 从而提高整体重建质量。

3.2.1 性别分类器

首先, 在CelebA上训练一个CNN性别分类器, 其组成如下:

Conv Layer 1:包含32个滤波器, 每个滤波器尺寸为3×3, 最后通过2×2大小的最大池化(max-pooling)对图像进行下采样处理使尺寸缩减为原来的一半(64×64像素)。

Conv Layer 2和3:第2卷积层(3×3×32)和第3卷积层(3×3×64)分别以第1和第2卷积层的输出作为输入, 输入通道的数量对应于先前卷积层中的滤波器个数。

Flatten Layer:由于卷积层输出的是4维张量, 现欲将其用作全连接网络的输入, 因此需要将输出重新塑造为2维张量。

Fully-connected Layer 1:输入来自之前的Flatten层, 全连接层中的神经元数量为128, 使用修正线性单元(ReLU)作为激活函数。

Fully-connected Layer 2:输入向量长度为128, 输出向量长度为2, 以确定输入图像属于哪种类别(“男”或“女”), 这里不使用ReLU函数, 而是通过Softmax函数对网络输出进行归一化处理。

TensorFlow中内置有可用于计算交叉熵(cross-entropy)的函数, 其主要用于对分类效果的性能进行度量评价, 然后通过对神经网络层中的参数变量进行适当调整, 使模型更好地对输入图像进行分类。交叉熵是一个连续的正函数, 若模型预测输出与期望输出完全一致则交叉熵为零, 因此网络的优化目标是最小化交叉熵。在计算出每个图像的分类交叉熵之后, 为了使用交叉熵来指导模型参数变量的优化, 因而需要一个标量值, 此处选择所有图像分类交叉熵的平均值。

另外, 选取Adam优化器对模型训练过程进行优化。Adam是一种可以替代传统随机梯度下降(SGD)过程的一阶优化算法, 它能基于训练数据迭代地更新神经网络权重。Adam算法与传统SGD算法的不同之处在于, SGD保持单一的学习率更新所有权重, 学习率在整个训练过程中不会发生改变。而Adam通过计算梯度的一阶和二阶矩估计来为不同的参数设计独立的自适应学习率, 使得整体训练过程尽可能接近最优。

需要注意的是, 最初性别分类器在训练集上的准确率为0.938, 经过10个epoch后分类器在测试集上的准确率为0.856。如3.1节中所述, 由于该实验对样本图像(178×218像素)做了大幅裁剪(64×64像素), 几乎只保留了原图中的人脸面部, 因而分类器基本不能依据颈部或头发等特征来进行区分。鉴于上述情况, 分类器仅通过面部形状及特征完成分类, 故取得当前准确率已属较为理想。

之后, 如前文2.3节所述, 固定性别分类器的权重并将网络导入SRGAN模型, 使用分类器来计算类别损失, 然后将类别损失项添加至生成器损失中。在尝试过不同大小的类别损失权重后最终确定数值为0.5, 因为从结果上来看此时的重建质量最佳。

图 5所示为随机选取的生成结果, 观察可知, SRGAN和class-info SRGAN输出结果几乎相同, 无法显式地表现出两者之间的真实性别差异。图像4展示了SRGAN产生错误输出的女性图像, 值得注意的是, class-info SRGAN模型会产生更加女性化的面孔(图像4(d))。

图 5 添加性别分类器的类别信息生成式对抗网络的超分辨输出结果
Fig. 5 Output results of class-info SRGAN by adding gender classifier ((a) 16×16 pixels down-sampling; (b) bicubic interpolation; (c) SRGAN; (d) proposed; (e) 64×64 pixels original)

表 1展示了对应于图 5中两种重建模型示例样本的分类准确率。由表 1中数据可知, 图像1、图像3、图像4 class-info SRGAN的生成结果分类准确率均高于SRGAN, 第2栏中两者结果也十分接近, 因而从整体上来看class-info SRGAN模型重建结果的性别特征识别率更高, 说明其重建质量更佳。

表 1 SRGAN模型与class-info SRGAN模型示例样本在性别分类器上的分类准确率比较
Table 1 Comparison of classification accuracy between examples of SRGAN model and class-info SRGAN model on gender classifier

下载CSV
/%
SRGAN class-info SRGAN
图像1 69 97
图像2 98 93
图像3 24 59
图像4 8 58

综合以上结果, 分类器类别损失项在超分辨模型中确实发挥了作用, 但由于性别属于一种较为宽泛的特征类别范畴, 包含内容众多, 却未涉及具体的细节信息, 以至于模型无法全面有效地学习该类别特征(具体分析见3.2.2节)。为了检验该假设, 需要选择一种更为具体的类别信息, 比如眼镜。

3.2.2 眼镜分类器

此处设置相同结构的CNN分类器模型, 并将输入的性别标签更换为眼镜标签, 与通过训练性别分类器向模型提供性别特征信息最终实现超分辨重建的方法类似, 添加眼镜分类器的class-info SRGAN模型的重建结果如图 6所示。由图可知, 相较于SRGAN, class-info SRGAN生成的眼镜看起来更加清晰并准确覆盖了眼部周围。

图 6 添加眼镜分类器的类别信息生成式对抗网络的超分辨输出结果
Fig. 6 Output results of class-info SRGAN by adding eyeglasses classifier ((a) 16×16 pixels down-sampling; (b) bicubic interpolation; (c) SRGAN; (d) proposed; (e) 64×64 pixels original)

分析产生该现象的原因, 相比于性别特征, 眼镜本身属于一种易于被察觉且十分具体的类别特征, 故分类器中相应类别损失项的阈值范围会受到更加明确的限定, 这样更有利于网络的训练与收敛, 因而模型也就更容易学习并生成具有对应特征的重建图像。

为了表明实验中上述结果的产生并非偶然, 现再次从class-info SRGAN模型在CelebA数据集的重建结果中随机选取如图 7所示的4幅图像, 其中图 7(a)(c)分别对应着添加性别分类器与眼镜分类器的class-info SRGAN模型生成图像, 图 7(b)图 7(d)对应着原始高分辨率图像。可以看到, 生成图像的内容清晰, 轮廓分明, 而且针对所添加的特征类别信息表征均较为明显。

图 7 类别信息生成式对抗网络的超分辨在CelebA上的重建结果
Fig. 7 Reconstruction results on CelebA of class-info SRGAN ((a) the proposed algorithm results by adding gender classifier proposed; (b) original; (c) the proposed algorithm results by adding eyeglasses classifier; (d) original)

3.3 其他数据集

为了进一步说明文中方法的有效性, 本文还在Fashion-mnist[21]和Cifar-10[22]数据集上实现了该模型。

3.3.1 Fashion-mnist数据集

Fashion-mnist作为Mnist手写数字数据集的一种替代, 涵盖了来自10种类别的共计7万个不同商品的正面图像。Fashion-mnist的大小、格式和训练/测试集划分与原始的Mnist数据集完全一致, 而原来Mnist中的数字09现在依次对应着T恤、裤子、套衫、裙子、外套、凉鞋、汗衫、运动鞋、包和踝靴这些物品。

此处, 对原始Fashion-mnist数据集(28×28像素的灰度图片)通过4倍采样因子降采样处理作为超分辨模型的输入。由于该数据集中的商品可识别度高, 而且分布相当均匀, 因而有助于更好地了解不同类型商品的重建情况, 同时也期望能够实现比原始SRGAN模型更好的性能效果。

最终结果如图 8所示, 为了便于比较, 设置生成图像由两部分构成, 其中图 8(a)表示class-info SRGAN的结果, 图 8(b)表示SRGAN的结果。对比图 8(a)(b)可以看出, 前者在清晰度、纹理和轮廓等方面均优于后者, 从而证实了附加的特征类别信息对超分辨重建结果的显著作用。

图 8 类别信息生成式对抗网络的超分辨模型与生成式对抗网络的超分辨模型生成结果比较
Fig. 8 Comparison of generated results between class-info SRGAN model and SRGAN model ((a) results of class-info SRGAN on Fashion-mnist; (b) results of SRGAN on Fashion-mnist)

3.3.2 Cifar-10数据集

Cifar-10由包含10个类别(飞机、汽车、鸟、猫、鹿、狗、蛙、马、船、卡车)的60 000幅彩色图像(32×32像素)构成, 每个类别有6 000幅, 数据集总共被划分成50 000幅训练图像和10 000幅测试图像。

图 9图 10分别展示了SRGAN模型与class-info SRGAN模型关于Cifar-10数据集各自的实验结果。从两幅图可以看出, 使用class-info SRGAN生成的图像比使用SRGAN生成的图像看起来更加干净清晰。

图 9 生成式对抗网络的超分辨在Cifar-10上的重建结果
Fig. 9 Reconstruction results of SRGAN on Cifar-10
图 10 类别信息生成式对抗网络的超分辨在Cifar-10上的重建结果
Fig. 10 Reconstruction results of class-info SRGAN on Cifar-10

但同时也注意到, 相比于class-info SRGAN模型之前在CelebA与Fashion-mnist数据集上的重建结果, 此时的图像清晰度并不理想, 细节特征也并不突出, 其中部分图像基本只能通过大致轮廓进行辨识, 而SRGAN模型的重建效果甚至更差。

3.3.3 结果分析

如前文所述, 对于背景复杂, 内容丰富, 细节信息数量较多的数据集, class-info SRGAN模型的效果可能并不十分显著。3.3.2节中的实验结果验证了该假设, 重建图像质量相比于SRGAN模型并无明显提升, 体现出特征类别信息的适用范围, 反映出class-info SRGAN模型存在一定的局限性。现从网络结构与算法方面进行对此分析。

首先, 使用本文方法在复杂数据集上实现重建时必须添加多种类型的类别信息。同时添加这些类别信息的难度较高, 而且如何对这些附加信息进行叠加组合从而使其能够发挥出较为理想的作用来指导模型最终生成对应的细节特征还有待研究。

其次, 如前文所述, class-info SRGAN模型产生作用的关键在于分类器类别损失项的引入, 在类别信息尚不明确或同时加入多种类别信息的情况下, 会使得相应的类别损失项阈值范围得不到更加具体的限定, 造成后期反向传播训练的参数更新不够准确及时, 从而减弱了对超分辨模型的训练和收敛原有的指导作用。

最后, 由于原始SRGAN模型为了获得较大的放大倍数而采用ResNet网络结构, 因而在判别器与生成器中并未使用到全连接层, 从而无法将关联特征合并至生成器与判别器当中。故与使用全连接层的网络结构相比, 额外的复杂度会使得模型在整个训练过程中对于超参数的调节变得十分敏感。因而大量特征类别信息的加入对于当前的网络结构而言会影响到整体训练的稳定性, 进而使类别信息的作用受到抑制, 最终导致重建质量无显著提高。

4 结论

本文提出一种基于类别信息生成式对抗网络的超分辨模型(class-info SRGAN), 经标准数据集(CelebA、Fashion-mnist和Cifar-10)测试表明, 通过对原始SRGAN模型的损失函数添加具体的类别损失项, 从而引入特征类别信息, 改进了超分辨模型的优化目标, 使得重建结果的特征表示更加突出, 有助于实现更好的重建结果, 为后续相关工作的开展创造了条件。

但同时也发现, 在模型没有尽可能多地学习到具有明确属性的特征信息, 或者重建对象包含十分复杂的细节特征的情况下, 特征类别信息的作用有一定局限。不过, 总体来说, 对于相对简单的具体属性特征, class-info SRGAN仍是一种较为理想的超分辨模型。

随着GANs的研究与发展, 可实现同时添加多种类别信息的class-info SRGAN模型以及引入类别信息后可应用于多种任务的泛化能力更强的class-info SRGAN模型, 都将可能会成为未来基于生成式对抗网络的超分辨重建研究的重点。

参考文献

  • [1] Glasner D, Bagon S, Irani M.Super-resolution from a single image[C]//Proceeding of the 12th International Conference on Computer Vision.Kyoto, Japan: IEEE, 2009: 349-356.[DOI: 10.1109/ICCV.2009.5459271]
  • [2] Nasrollahi K, Moeslund T. Super-resolution:a comprehensive survey[J]. Machine Vision and Applications, 2014, 25(6): 1423–1468. [DOI:10.1007/s00138-014-0623-4]
  • [3] Dong C, Loy C C, He K M, et al.Learning a deep convolutional network for image super-resolution[C]//Proceeding of the 13th European Conference on Computer Vision.Zurich, Switzerland: Springer, 2014: 184-199.[DOI: 10.1007/978-3-319-10593-2_13]
  • [4] Goodfellow I J, Pouget-Abadie J, Mirza M, et al.Generative adversarial nets[C]//Proceedings of the 27th International Conference on Neural Information Processing Systems.Montreal, Canada: MIT Press, 2014: 2672-2680.
  • [5] Ledig C, Theis L, Huszár F, et al.Photo-realistic single image super-resolution using a generative adversarial network[C]//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, Hawaii, USA: IEEE, 2017: 105-114.[DOI: 10.1109/CVPR.2017.19]
  • [6] Freeman W T, Jones T R, Pasztor E C. Example-based super-resolution[J]. IEEE Computer graphics and Applications, 2002, 22(2): 56–65. [DOI:10.1109/38.988747]
  • [7] Arya S, Mount D M, Netanyahu N S, et al. An optimal algorithm for approximate nearest neighbor searching fixed dimensions[J]. Journal of the ACM, 1998, 45(6): 891–923. [DOI:10.1145/293347.293348]
  • [8] Keys R. Cubic convolution interpolation for digital image processing[J]. IEEE Transactions on Acoustics, Speech, and Signal Processing, 1981, 29(6): 1153–1160. [DOI:10.1109/TASSP.1981.1163711]
  • [9] Lukin A, Krylov A S, Nasonov A.Image interpolation by super-resolution[C]//Proceedings of the 16th International Conference on Computer Graphics and Vision GraphiCon'2006.2006: 239-242.
  • [10] Yuan S, Abe M, Taguchi A, et al.High accuracy WaDi image interpolation with local gradient features[C]//2005 International Symposium on Intelligent Signal Processing and Communication Systems.Hong Kong, China: IEEE, 2005, 105: 49-54.[DOI: 10.1109/ISPACS.2005.1595352]
  • [11] Yang J C, Wright J, Huang T S, et al. Image super-resolution via sparse representation[J]. IEEE Transactions on Image Processing, 2010, 19(11): 2861–2873. [DOI:10.1109/TIP.2010.2050625]
  • [12] Zhang Z, Xu Y, Yang J, et al. A survey of sparse representation:algorithms and applications[J]. IEEE Access, 2015, 3: 490–530. [DOI:10.1109/ACCESS.2015.2430359]
  • [13] Dahl R, Norouzi M, Shlens J.Pixel recursive super resolution[C]//Proceeding of 2017 IEEE International Conference on Computer Vision.Venice, Italy: IEEE, 2017: 5449-5458.[DOI: 10.1109/ICCV.2017.581]
  • [14] Johnson J, Alahi A, Li F F.Perceptual losses for real-time style transfer and super-resolution[C]// Proceeding of the 14th European Conference on Computer Vision.Amsterdam, The Netherlands: Springer, 2016.[DOI: 10.1007/978-3-319-46475-6_43]
  • [15] Kim J, Lee J K, Lee K M.Accurate image super-resolution using very deep convolutional networks[C]//Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition.Las Vegas, NV, USA: IEEE, 2016.[DOI: 10.1109/cvpr.2016.182]
  • [16] Dong C, Loy C C, Tang X O.Accelerating the super-resolution convolutional neural network[C]//Proceedings of the 14th European Conference on Computer Vision.Amsterdam, The Netherlands: Springer, 2016.[DOI: 10.1007/978-3-319-46475-6_25]
  • [17] Radford A, Metz L, Chintala S.Unsupervised representation learning with deep convolutional generative adversarial networks[J].arXiv preprint arXiv: 1511.06434, 2015.
  • [18] He K M, Zhang X Y, Ren S Q, et al.Deep residual learning for image recognition[C]//Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition.Las Vegas, NV, USA: IEEE, 2016: 770-778.[DOI: 10.1109/CVPR.2016.90]
  • [19] Simonyan K, Zisserman A.Very deep convolutional networks for large-scale image recognition[J].arXiv preprint arXiv: 1409.1556, 2014.
  • [20] Liu Z W, Luo P, Wang X G, et al.Deep learning face attributes in the wild[C]//Proceedings of 2015 IEEE International Conference on Computer Vision.Santiago, Chile: IEEE, 2015: 3730-3738.[DOI: 10.1109/ICCV.2015.425]
  • [21] Xiao H, Rasul K, Vollgraf R.Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms[J].arXiv preprint arXiv: 1708.07747, 2017.
  • [22] Krizhevsky A. Learning Multiple Layers of Features from Tiny Images[J]. Toronto, California:University of Toronto, 2009: 54–60.