基于改进稀疏编码的图像超分辨率算法
摘 要: 针对传统基于稀疏字典对的超分辨率(SR)算法训练速度慢、字典质量差、特征匹配准确性低的缺点,提出一种基于改进稀疏编码的图像超分辨率算法。该算法使用自适应阈值的形态组成分析(MCA)方法提取图像特征,并采用主成分分析算法对训练集进行降维,提高特征提取的有效性,缩短字典训练时间,减少过拟合现象。在字典训练阶段,使用改进的稀疏K-奇异值分解(K-SVD)算法训练低分辨率字典,结合图像块的重叠关系求解高分辨率字典,增强字典的有效性和自适应能力,同时极大地提高了字典的训练速度。在Lab颜色空间对彩色图像进行重建,避免由于颜色通道相关性造成的重建图像质量下降。与传统方法相比,该算法重建图像质量和计算效率更优。 关键词: 超分辨率;稀疏表示;形态组成分析;主成分分析;颜色空间;机器学习 中图分类号: TP391.41 文献标志码:A Image super-resolution algorithm based on improved sparse coding Abstract: The traditional Super-Resolution (SR) algorithm, based on sparse dictionary pairs, is slow in training speed, poor in dictionary quality and low in feature matching accuracy. In view of these disadvantages, a super-resolution algorithm based on the improved sparse coding was proposed. In this algorithm, a Morphological Component Analysis (MCA) method with adaptive threshold was used to extract picture feature, and Principal Component Analysis (PCA) algorithm was employed to reduce the dimensionality of training sets. In this way, the effectiveness of the feature extraction was improved, the training time of dictionary was shortened and the over-fitting phenomenon was reduced. An improved sparse K-Singular Value Decomposition (K-SVD) algorithm was adopted to train low-resolution dictionary, and the super-resolution dictionary was solved by utilizing overlapping relation, which enforced the effectiveness and self-adaptability of the dictionary. Meanwhile, the training speed was greatly increased. Through the reconstruction of color images in the Lab color space, the degradation of the reconstructed image quality, which may be caused by the color channels correlation, was avoided. Compared with traditional methods, this proposed approach can get better high-resolution images and higher computational efficiency. Key words: super-resolution; sparse representation; Morphological Component Analysis (MCA); Principal Component Analysis (PCA); color space; machine learning 0 引言 超分辨率(Super-Resolution, SR) 即通过硬件或软件的方法提高原有图像的分辨率,通过一系列低分辨率图像来得到一幅或多幅高分辨率的图像过程。因其能够提供更高的像素密度和更多的细节,超分辨率技术在医学图像、卫星图像、监控等领域获得了广泛的应用。由于成本较高、工艺水平限制等原因,通过硬件提升获取高分辨率图像并不是经济的手段,所以现有的SR方法主要集中在软件领域,主要分为三类:基于插值的方法、基于重建的方法和基于学习的方法。 基于插值的方法简洁快速,但易产生模糊的边缘和不清晰的细节。常见方法有:双线性插值、双立方插值、基于自适应的2-D回归模型[1]等。基于重建的方法根据图像降质模型,利用各种先验知识来估计超分辨率图像,这类算法可以重建出较好的边缘,降低锯齿效应,但其使用的先验知识往往具有局限性,如轮廓梯度信息[2]、边缘信息[3]等。 基于学习的方法使用高分辨率和低分辨率图片训练集来预测低分辨图像中丢失的高频信息。通过训练字典,这类算法可以产生低分率图像中没有的细节信息,但是对训练集的依存度比较高,同时对噪声的抑制能力差。Freeman等[4]利用马尔可夫随机场,通过置信传播来建立低分辨图像块和高分辨率图像块之间的映射关系,需要的图片数量较大,且训练时间较长。Chang等[5]则采用流形学习算法,使用局部线性嵌入(Local Linear Embedding, LLE)规则,映射低分辨率图像块的局部特征到高分辨率图像块,然后通过近邻的线性组合来产生高分辨率图像块;该方法虽需要较少的样本图片,但易产生欠拟合或过拟合现象。Gao等[6]在LLE的基础上,提出了一种稀疏邻域选择算法来重建图像,该算法虽然解决了欠拟合和过拟合现象,但对于复杂结构图像的重建效果差。Yang等[7-9] 使用稀疏表示算法,利用高、低分辨率图像块之间的稀疏关联建立词典对,低分辨率的稀疏表示可用来重建高分辨图像;虽然这种方法重建效果较好,但训练时间过长,字典缺乏有效性。杨玲等[9]使用K-奇异值分解(K-Singular Value Decomposition, K-SVD)方法训练字典,利用RGB颜色通道的稀疏表示提取彩色图像块,训练速度较快;然而直接使用低分辨率图像本身作为训练集,虽保持了颜色信息,但造成特征冗余,易出现过拟合现象。Wang等[10]结合Yang[7]和Freeman[4]方法的优点,采用稀疏表示方法对图像中的中、低频信息进行编码,虽然提高了字典的有效性,但自适应能力差,训练时间长。 针对传统方法的缺点,本文提出一种使用改进稀疏编码的单张图像超分辨率算法。使用自适应阈值的 形态组成分析(Morphological Component Analysis, MCA)方法提取低分辨率图像的纹理和几何结构特征,采用高分辨率的高频分量构建训练集。针对训练集过大的缺点,使用主成分分析(Principal Components Analysis, PCA)算法对训练集进行降维,降低计算复杂度和字典尺寸。为了提高训练速度,使用改进的稀疏K-SVD算法进行稀疏字典的训练。同时,字典具有很好的灵活性和自适应性。根据图像块的重叠关系,优化求解高分辨率字典,所得字典质量更好。在图像重建时,利用Lab颜色空间的特点,避免颜色通道的操作对图像一致性造成的影响。 2 本文算法 基于稀疏表示的超分辨率模型的主要内容包含三个方面:特征提取、训练稀疏字典和重建超分辨率图像。本文使用自适应阈值的MCA方法提取低分辨图像特征与高分辨率图像块的高频分量作为训练集,用PCA方法对训练集进行降维;使用改进的稀疏K-SVD算法训练低分辨率字典,然后利用图像块的重叠关系求解高分辨率字典;在Lab颜色空间重建图像,所得图像质量更优。 2.1 稀疏字典学习 稀疏字典的训练方法可以分为两类:基于分析的方法和基于学习的方法。基于分析的方法一般首先构建数据的数学模型,然后使用一个分析结构去表示这个模型,Wavelets、Contourlets等均属于这类方法。在基于学习的方法中,稀疏字典是采用机器学习方法,从训练集中学习得到。这类方法具有很好的自适应能力,实际应用表现更好,但具有较高的计算复杂度,较多的限制条件和冗余,这类方法包含PCA、K-SVD等。 2.1.1 改进的稀疏K-SVD算法 Rubinstein等[13]在K-SVD[12]算法的基础上,提出了稀疏K-SVD算法。这种算法结合了两类学习方法的优点,采用加入“基字典”的稀疏模型,使用这个新的参数框架训练字典,具有较低的计算复杂度、更好的自适应性和稳定性;而且稀疏K-SVD可以和任意追踪算法组合使用,便于进行改进。 针对超分辨率传统字典训练方法耗时长、字典质量差的缺点,本文对使用类似Smith等[14]的方法对稀疏K-SVD进行改进,进一步提高其训练效率,当处理规模较大的训练集时,优势明显。改进措施在稀疏K-SVD的两个主要部分进行:字典更新阶段和稀疏编码阶段。在字典更新阶段,通过引入“更新循环”机制,即将仅循环一次的字典更新过程循环多次。这是因为字典训练时间大部分消耗在稀疏编码阶段,仅进行一次更新循环往往并不能得到最优的结果,而循环多次,也并不会明显增加训练时间,反而能够降低稀疏编码阶段的负荷,提高字典学习的效率。改进的稀疏K-SVD过程见算法2。 在稀疏编码阶段,使用上轮追踪过程后得到的k/3个(k为系数稀疏度)最大的系数进行初始化,然后计算剩余的2k/3个系数。系数重用操作更改OMP(Orthogonal Matching Pursuit)算法并不能带来明显的速度提升,当加入类似CoSaMP(Compressive Sampling Matching Pursuit)[15]中的“支集合并”和“剪枝”操作,改进Batch-OMP[17]就可以明显地提高编码的效率,达到快速执行编码的目标。“支集合并”操作:将当轮近似过程计算的结果与已经计算出的集合进行合并,然后计算稀疏表示。“剪枝”操作:从由最小二乘法计算出的近似结果中选出最大的k(或者小于k)个系数。具体过程见算法1。 算法1 改进Batch-OMP算法 2.2 图像特征提取与训练集构建 由于人眼对高频信息更加敏感,传统方法一般选择低分辨率图像的高频信息作为特征,例如拉普拉斯算子、高斯微分函数和梯度提取算子等。但是,它们通常只考虑到图像的几何特征,图像的纹理特性被忽略掉了,无法完整地体现图像的视觉特征。本文使用自适应阈值的MCA[17]来解决这个问题。 4 结语 本文提出了一种基于改进稀疏编码的图像超分辨率新方法。使用MCA/MOM方法提取低分辨率特征和高分辨率的高频分量作为训练集,对训练集进行降维,减少所需样本数量与字典训练所需时间,降低字典尺寸。使用改进的稀疏K-SVD算法和优化的字典对求解过程,能快速高效地得到超分辨重建所需字典。在Lab颜色空间重建所得图像能够保持颜色通道的一致性。虽然本文方法可以有效提高图像重建质量和计算效率,但利用图片本身的相似性来减少训练所需样本数量,提高特征提取效率;进一步提高该算法以应用到实时系统中;如何应用该算法到视频的超分辨率重建中都将是下一步的研究方向。 参考文献: [1] ZHANG X, WU X. Image interpolation by adaptive 2-D autoregressive modeling and soft-decision estimation [J]. IEEE Transactions on Image Processing, 2008,17(6): 887-896. [2] MARQUINA A, OSHER S J. Image super-resolution by TV-regularization and Bregman iteration [J]. Journal of Scientific Computing, 2008,37(3): 367-382. [3] TAI Y W, LIU S, BROWN M S, et al. Super resolution using edge prior and single image detail synthesis[C]// CVPR 2010: Proceedings of the 2010 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2010: 2400-2407. [4] FREEMAN W T, JONES T R, PASZTOR E C. Example-based super-resolution [J]. Computer Graphics and Applications, 2002, 22(2): 56-65. [5] CHANG H, YEUNG D Y, XIONG Y. Super-resolution throughneighbor embedding[C]// CVPR 2004: Proceedings of the 2004 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2004.:275-282. [6] GAO X, ZHANG K, TAO D, et al. Joint learning for single-image super-resolution via a coupled constraint [J]. IEEE Transactions on Image Processing, 2012, 21(2): 469-480. [7] YANG J, WRIGHT J, HUANG T S, et al. Image super-resolution via sparse representation [J]. IEEE Transactions on Image Processing, 2010,19(11): 2861-2873. [8] ZEYDE R, ELAD M, PROTTER M. On single image scale-up using sparse-representations [C]// Proceedings of the 7th International Conference, LNCS 6920. Berlin: Springer-Verlag, 2012: 711-730. [9] YANG L, LIU Y, HUANG R, et al. New approach for super-resolution from a single color image based on sparse coding [J]. Journal of Computer Applications, 2013,33(2):472-475.(杨玲, 刘怡光, 黄蓉刚, 等. 新的基于稀疏表示单张彩色超分辨率算法[J]. 计算机应用, 2013, 33(2): 472-475.) [10] WANG J, ZHU S, GONG Y. Resolution enhancement based on learning the sparse association of image patches [J]. Pattern Recognition Letters, 2010, 31(1):1-10. [11] DONOHO D L. For most large underdetermined systems of linear equations the minimal l1‐norm solution is also the sparsest solution [J]. Communications on Pure and Applied Mathematics, 2006, 59(6): 797-829. [12] AHARON M, ELAD M, BRUCKSTEIN A. K-SVD: an algorithm for designing of overcomplete dictionaries for sparse representation [J]. IEEE Transactions on Signal Processing, 2006,54(11): 4311-4322. [13] RUBINSTEIN R, ZIBULEVSKY M, ELAD M. Double sparsity: learning sparse dictionaries for sparse signal approximation [J]. IEEE Transactions on Signal Processing, 2010,58(3):1553-1564. [14] SMITH L N, ELAD M. Improving dictionary learning: multiple dictionary updates and coefficient reuse [J]. Signal Processing Letters, 2013, 20(1): 79-82. [15] NEEDELL D, TROPP J A. CoSaMP: iterative signal recovery from incomplete and inaccurate samples [J]. Applied and Computational Harmonic Analysis, 2009,26(3): 301-321. [16] RUBINSTEIN R, ZIBULEVSKY M, ELAD M. Efficient implementation of the K-SVD algorithm using batch orthogonal matching pursuit [R/OL]. [2012-10-10].http://www.yumpu.com/en/document/view/6635304/efficient-implementation-of-the-k-svd-algorithm-using-technion. [17] STARCK J L, MOUDDEN Y, BOBIN J, et al. Morphological component analysis[C]// Proceedings of the 11th SPIE Conference on Signal and Image Processing: Wavelet Applications in Signal and Image Processing. San Diego: SPICE, 2005, 59(14):1-15. [18] BOBIN J, STARCK J L, FADILI J M, et al. Morphological component analysis: an adaptive thresholding strategy[J]. IEEE Transactions on Image Processing, 2007,16(11): 2675-2681. [19] NING Q, CHEN K, YI L, et al. Image super-resolution via analysis sparse prior[J]. Signal Processing Letters, 2013, 20(4): 399-402. [20] IRANI M, PELEG S. Motion analysis for image enhancement: resolution, occlusion, and transparency[J]. Journal of Visual Communication and Image Representation, 1993, 4(4): 1993-12. [21] WANG Z, BOVIK A C, SHEIKH H R, et al. Image quality assessment: from error visibility to structural similarity [J]. IEEE Transactions on Image Processing, 2004, 13(4):600-612.