Multi-focus image fusion method based on improved VGG network
-
摘要: 为更好地保留原图像信息,提高图像融合性能,提出一种改进VGG卷积神经网络与边缘像素统计特征相结合的融合算法。首先,该算法将完整图像拆分成图像块,以图像块的预处理来获取较高的图像分类,精度达到0.985以上,以改进的VGG卷积神经网络来加快模型收敛速度,当图像块输入到网络当中,可以初步得到二分类的权值矩阵。其次,在高频细节部分,对于左聚焦图像和右聚焦图像的清晰模糊模块分别进行模糊化处理,根据像素点之间的统计特征经阈值分割后得到有明显边界的权值矩阵。最后,结合两次分割的权值矩阵,通过加权求和的融合策略,得到处处清晰的聚焦图像。为说明算法有效性,在实验部分展示其融合主观视觉效果图与信息熵等客观评价,该算法对比其他算法表现突出,可较好地保留原图像的信息。Abstract: In order to better retain the original image information and improve the image fusion performance, an improved fusion algorithm combining visual geometry group(VGG) convolutional neural network with edge pixel statistical features was proposed. Firstly, this algorithm divided the complete image into image blocks, preprocessed the image blocks to obtain a higher image classification accuracy of 0.985 or more, and used the improved VGG convolutional neural network to accelerate the convergence of the model. When the image blocks were input into the network, the weight matrix of binary classification could be preliminarily obtained. Secondly, in the high-frequency detail part, the clear blur modules of left-focus image and right-focus image were respectively subjected to blurring processing, and the weights matrix with obvious boundaries was obtained by the threshold segmentation based on the statistical feature between the pixel points. Finally, combined with the two-step weight matrix, the fusion strategy of weighted sum was used to obtain the clear focus image. In order to illustrate the effectiveness of the algorithm, the experimental part shows the objective evaluation of its fusion subjective visual effect diagram and information entropy, which is outstanding compared with other algorithms and can better retain the information of the original image.
-
Keywords:
- image fusion /
- VGG /
- image segmentation /
- statistical features /
- multi-focus image
-
引言
图像融合是图像处理中的重要部分,能够协同利用同一场景的多种传感器图像信息,输出一幅更适合于人类视觉感知或计算机进一步处理与分析的融合图像。它可明显改善单一传感器的不足,提高结果图像的清晰度及信息包含量,有利于更为准确、可靠、全面地获取目标或场景信息。
在可见光图像中成像设备捕获目标图像,对于捕获目标部分的有效聚焦图像是清晰可见的,而非目标区域的其他物体则为模糊。因此,对于光学透镜捕捉的成像图很难做到所有物体处处聚焦,提出多种多焦点图像融合算法[1]。总的来说,这些方法可以分为两类:变换域方法和空间域方法[2],多尺度变换(MST)是最常用的变换域方法之一。传统的融合方法包括基于金字塔的图像融合[3]、基于剪切变换图像融合和基于非子采样轮廓变换(NSCT)[4]的图像融合算法等。最近提出的融合方法包括基于像素的融合方法,主要有引导滤波(DSIFT)[2]、基于多尺度加权梯度的图像融合算法(MWGF)[5]、基于低秩矩阵(LRR)[6]的多聚焦噪声图像融合算法、基于离散小波变换的多聚焦图像融合算法[7],随着深度学习的发展,结合深度学习解决多聚焦图像融合[8]的方法得到广泛推广,如基于卷积神经网络(CNN)的多聚焦图像融合[9-10]、基于全卷积网络的多聚焦图像融合[11-12]。对于一个简单的二分类问题,本文优先选择精度相对较高的VGGNet网络[13]进行修改。输入子块的多特征,保证了图像的分类精度。全图处理容易损失较多高频信息,于是本文只对左右图像的混合聚焦散焦部分进行处理,在信息熵、互信息等方面得到较好的融合效果。
1 网络结构模型
1.1 VGG16模型介绍
VGGNet[13]是由牛津大学的K.Simonyan和A.Zisserman提出的卷积神经网络模型,该模型诠释了隐层深度对于预测精度的影响,训练时间和AlexNet相比大大减少。该模型在ImageNet中达到了92.7%的top5测试精度,VGGNet结构根据层数的不同分为不同的版本,常用的结构是VGG16和VGG19,在VGG16中所有的卷积层都有相同的配置,卷积层中卷积核大小为
$3 \times 3$ ,步长大小为1,最大池化层共5个,其核大小都为$2 \times 2$ ,步长为2;全连接层共3个,前两层共有4 096个通道,第3层共1 000个标签类别;最后一层为Softmax层;所有隐层后都带有ReLU非线性激活函数,总体结构如图1所示。1.2 Crop-VGG网络结构
本文只需要处理聚焦图和散焦图的简单二分类问题,并不需要过深的隐层,多个残余的隐层影响了训练速率,通过逐个隐层删除,部分隐层添加,最终设计为本文的Crop-VGG网络,在保证精度的同时提高了训练速率。
如图2所示,Crop-VGG是基于VGG16对二分类问题的更改,并不需要过深的网络层,于是裁剪了一部分网络,在保留原有分类效果的同时,提高分类速度。与原网络相比,Crop-VGG卷积层卷积核大小、池化层大小、步长都与原VGG网络保持一致,区别在于卷积层数由原来的13变为8,由2-2-3-3-3变为了2-3-3结构,最大池化层由5个变为3个,卷积层中卷积核大小都为
$3 \times 3$ ,步长为1,最大池化层核大小$2 \times 2$ ,步长为2;全连接层共3层,前两层通道数由原来的4 096变为2 048,输出类别变为2,每个隐层都跟有非线性激活函数ReLU,最后一层为Softmax层。基于caffe框架下,将预处理数据集网络训练,随着迭代次数增加,loss的收敛速度有明显提升,随着迭代次数增加,当loss值达到收敛后,精确率保持在0.985以上(如图3)。2 使用网络进行统计特征分类
2.1 数据预处理
步骤1) 选取纹理多样的一组清晰图,使用点扩散(point spread function)方法进行模糊处理。因为点源在经过任何光学系统后都会由于衍射而形成一个扩大的像点,通过测量系统的点扩展函数,能够更准确地提取图像信息,这里使用点扩散函数更加符合光学散焦过程。对于分类训练,需要扩大清晰和模糊的区分度,于是设置扩散半径r=10,获取一组聚焦和散焦图像。
步骤2) 将两组图像分别分割为
$32 \times 32$ 像素的小块。首先使用二维离散小波[14]变换对图像进行分解。设原始图像为${C^0} = (c_{mn}^0)$ ,则$$\left\{ \begin{array}{*{20}{l}} c_{m,n}^{ - i} = \dfrac{1}{2}\displaystyle\sum\limits_{k,l \in Z} c_{k,l}^{ - i + 1}{{\tilde h}_{k - 2n}}{{\tilde h}_{l - 2m}},\\ d_{m,n}^{ - i1} = \dfrac{1}{2}\displaystyle\sum\limits_{k,l \in Z} {c_{k,l}^{ - i + 1}{{\tilde h}_{k - 2n}}{{\tilde g}_{l - 2m}}\;} \\ d_{m,n}^{ - i2} = \dfrac{1}{2}\displaystyle\sum\limits_{k,l \in Z} c_{k,l}^{ - i + 1}{{\tilde g}_{k - 2n}}{{\tilde h}_{l - 2m}},\\ d_{m,n}^{ - i3} = \dfrac{1}{2}\displaystyle\sum\limits_{k,l \in Z} {c_{k,l}^{ - i + 1}{{\tilde g}_{k - 2n}}{{\tilde g}_{l - 2m}}\;} \; \end{array} \right.$$ (1) 式中:
$L = {({h_n})_{n \in Z}}$ 表示分解过程的低通滤波器;$H = $ ${({g_n})_{n \in Z}}$ 表示高通滤波器,${g_n} = {( - 1)^n}{h_{1 - n}},n \in Z$ ;而$\tilde L = $ ${({\tilde h_n})_{n \in Z}}$ ,$\tilde H = {({\tilde g_n})_{n \in Z}}$ 分别表示$L$ 、$H$ 的镜像滤波器,于是获取其横向HL、纵向LH以及对角HH的高频细节分别表示为$$\left\{ {\begin{array}{*{20}{l}} {D_{ - j}^{LH} = {{(d_{m,n}^{ - j1})}_{(m,n) \in {z^2}}}} \\ {D_{ - j}^{HL} = {{(d_{m,n}^{ - j2})}_{(m,n) \in {z^2}}}} \\ {D_{ - j}^{HH} = {{(d_{m,n}^{ - j3})}_{(m,n) \in {z^2}}}} \end{array}} \right.$$ (2) 再使用Sobel算子对图像进行卷积运算,提取轮廓纹理特征,并进行
$\dfrac{1}{2}$ 的下采样。步骤3) 将所有对应位置的Sobel算子处理后的图像与步骤2的HL、LH、HH拼接成一幅图像组作为输入训练数据输入目标网络中,完整步骤如图4所示。
2.2 分类训练
对于训练好的二分类网络模型逐块进行模糊评测[15],进行阈值为0.5的分割,其中,聚焦区块概率接近于1,散焦区块概率接近于0。对于介于中间聚焦散焦混合区块做如下判别:
$$\left\{ \begin{array}{l} y(i,j) = 1,\displaystyle\sum a \geqslant 2;\;{\rm{else}}\;y = 0 \\ x(i,j) = 1,\displaystyle\sum a \geqslant 3;\;{\rm{else}}\;x = 0 \\ c(i,j) = 1,\displaystyle\sum a \geqslant 5;\;{\rm{else}}\;c = 0 \end{array} \right.\;$$ (3) 式中
$y$ 、$x$ 、$c$ 为分别为四角区块、四边区域方块、中间区域方块,它们是否为1取决于周围方块$a$ 的聚焦块数量,这种方法可以将图像中空洞区域块有效去除,如图5所示。2.3 基于统计特征的像素分割
通过分类训练后对目标图A和目标图B进行了分类处理,如图6所示,依据形态学分割[16]为3个权重矩阵,分别为
$\alpha $ 、$\;\beta $ 、$\gamma $ 。其中$\alpha $ 、$\;\beta $ 为已确定的聚焦区域的权值矩阵,只需要对γ矩阵的细节处理。$T1$ 、$T2$ 是由两幅原聚焦图像通过$\gamma $ 权值矩阵分割出来的聚焦散焦混合部分,即:$$ \begin{aligned} \; \\ & \left\{ {\begin{array}{*{20}{l}} {T1 = A \times \gamma } \\ {T2 = B \times \gamma } \end{array}} \right. \end{aligned} $$ (4) 分别对T1和T2进行点扩散函数
$\partial $ 的散焦处理,$\varphi $ 函数用来求目标像素点与$3 \times 3$ 区域邻近像素点方差,通过统计像素点之间的模糊变化关系,经过阈值分割后能够提高在边界部分像素点区分度,如(5)式所示:$$\left\{ {\begin{array}{*{20}{l}} {GA = \varphi {{(T1 - \partial (T2))}^2}} \\ {GB = \varphi {{(T2 - \partial (T1))}^2}} \end{array}} \right.$$ (5) 由于只判断中间混合区域,因此本文方法实现时受全局误判点干扰较少,边界部分信息明确,生成初步边界区域明显的分割权值图像矩阵
$\tau 1$ :$$\left\{ {\begin{array}{*{20}{l}} {\tau 1(i,j) = 1,GA \geqslant GB} \\ {\tau 1(i,j) = 0,GA < GB} \end{array}} \right.$$ (6) 对
$\tau 1$ 中的空洞点再进行一次形态学空洞补全的修复处理,得到最终分割区域明显的$\tau 2$ 权值矩阵。最终的融合图像$AB$ 为$$AB = A\times\alpha + B\times\beta + T1\times\tau 2 + T2\times(1 - \tau 2)$$ (7) 3 实验结果
在实验中,我们使用了几对输入图像作为测试图像,验证了该方法的可行性。将本文提出的多焦点图像融合算法与最新的多聚焦图像融合算法如MWGF[4]、DCTvarcv[17]、DSIFT[2]等进行了比较,下面介绍图像融合的详细讨论分析结果。
图7~图10展示了图像融合视觉质量的主观评价,为了对比不同的多聚焦图像算法的融合效果,选取4组多聚焦图像。Image A与Image B为需要融合的左右聚焦图,其他图像为每个算法对应的融合图像。例如,在图7中图片整体清晰度较高,在图8中,树木边缘参差的纹理特征比较其他算法接近于原始图像,除去边缘的其他细节部分完全保留原始图像信息,而在图9中手背部分与图10瓶子边界部分清晰程度较高。
表1~表5为Vegetables、Tree、A globe、The bottle 4类多聚焦融合图像在几种算法中的表现,通过数据结果可以看出本文算法在信息熵、平均梯度、图像清晰度、边缘信息保持度、互信息上的得分情况基本优于其他算法。这说明本文算法能够减少细节与边缘信息的损失,对于图像整体信息量保存较完整,边缘层次比较多,清晰度也明显高于其他算法。改进的VGG网络能够更好地保存高频信息,抽选两组表的数据在各类算法的比较如图11所示。
表 1 各类算法在信息熵的对比Table 1. Comparison of various algorithms in information entropy${Q_{\rm{E}}}$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 7.602 2 7.599 3 7.602 8 7.590 9 7.603 7 7.599 4 Tree 7.629 9 7.634 3 7.632 8 7.642 1 7.632 2 7.635 5 A globe 7.688 6 7.685 6 7.683 6 7.677 9 7.677 4 7.689 1 The bottle 7.617 6 7.628 9 7.628 3 7.625 2 7.618 1 7.623 5 表 2 各类算法在平均梯度的对比Table 2. Comparison of various algorithms in average gradient${Q_{{\rm{AG}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 7.084 2 7.434 3 7.422 1 7.292 9 7.442 8 7.487 3 Tree 13.597 2 14.551 9 14.546 14.554 14.533 4 14.589 6 A globe 8.473 3 8.875 8 8.850 7 8.847 5 8.865 9 8.884 1 The bottle 8.623 5 9.174 8 9.176 6 9.142 7 9.180 5 9.186 6 表 3 各类算法在图像清晰度的对比Table 3. Comparison of various algorithms in image clarity${Q_{{\rm{Fd}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 7.938 5 8.540 7 8.510 1 8.123 1 8.531 3 8.592 9 Tree 16.423 7 17.691 2 17.679 6 17.660 2 17.669 17.736 9 A globe 10.428 5 10.961 4 10.973 7 10.897 5 10.956 9 10.981 5 The bottle 10.156 7 10.915 9 10.946 4 10.834 4 10.923 5 10.928 9 表 4 各类算法在边缘信息保持度的对比Table 4. Comparison of various algorithms in edge information retention${Q_{{\rm{AB}}/{\rm{F}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 0.672 4 0.694 0 0.693 4 0.771 7 0.696 4 0.697 0 Tree 0.678 1 0.741 6 0.742 4 0.743 0 0.741 4 0.743 7 A globe 0.687 7 0.767 6 0.757 9 0.768 1 0.759 9 0.770 8 The bottle 0.693 3 0.801 6 0.793 2 0.8 0.795 6 0.803 8 表 5 各类算法在互信息的对比Table 5. Comparison of various algorithms in mutual information${Q_{{\rm{MI}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 4.663 4.728 7 4.756 5 4.709 6 4.770 4 4.758 6 Tree 3.327 4 5.021 8 5.418 4 5.215 6 4.563 9 5.401 8 A globe 4.967 6.277 1 6.41 6.334 8 5.640 9 6.468 5 The bottle 3.956 4 5.358 5.652 7 5.404 6 4.856 7 5.698 2 4 结论
本文提出的结合深度学习与统计特征的方法解决复杂的实际问题是可行的,Crop-VGG网络中能以较少运算速率保留更多的原始图像信息,同时结合统计特征的融合算法在各类指标上具有良好的表现,所以针对不同的问题复杂度设计相应的深度网络能更加便捷地处理问题。
-
表 1 各类算法在信息熵的对比
Table 1 Comparison of various algorithms in information entropy
${Q_{\rm{E}}}$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 7.602 2 7.599 3 7.602 8 7.590 9 7.603 7 7.599 4 Tree 7.629 9 7.634 3 7.632 8 7.642 1 7.632 2 7.635 5 A globe 7.688 6 7.685 6 7.683 6 7.677 9 7.677 4 7.689 1 The bottle 7.617 6 7.628 9 7.628 3 7.625 2 7.618 1 7.623 5 表 2 各类算法在平均梯度的对比
Table 2 Comparison of various algorithms in average gradient
${Q_{{\rm{AG}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 7.084 2 7.434 3 7.422 1 7.292 9 7.442 8 7.487 3 Tree 13.597 2 14.551 9 14.546 14.554 14.533 4 14.589 6 A globe 8.473 3 8.875 8 8.850 7 8.847 5 8.865 9 8.884 1 The bottle 8.623 5 9.174 8 9.176 6 9.142 7 9.180 5 9.186 6 表 3 各类算法在图像清晰度的对比
Table 3 Comparison of various algorithms in image clarity
${Q_{{\rm{Fd}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 7.938 5 8.540 7 8.510 1 8.123 1 8.531 3 8.592 9 Tree 16.423 7 17.691 2 17.679 6 17.660 2 17.669 17.736 9 A globe 10.428 5 10.961 4 10.973 7 10.897 5 10.956 9 10.981 5 The bottle 10.156 7 10.915 9 10.946 4 10.834 4 10.923 5 10.928 9 表 4 各类算法在边缘信息保持度的对比
Table 4 Comparison of various algorithms in edge information retention
${Q_{{\rm{AB}}/{\rm{F}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 0.672 4 0.694 0 0.693 4 0.771 7 0.696 4 0.697 0 Tree 0.678 1 0.741 6 0.742 4 0.743 0 0.741 4 0.743 7 A globe 0.687 7 0.767 6 0.757 9 0.768 1 0.759 9 0.770 8 The bottle 0.693 3 0.801 6 0.793 2 0.8 0.795 6 0.803 8 表 5 各类算法在互信息的对比
Table 5 Comparison of various algorithms in mutual information
${Q_{{\rm{MI}}} }$ LRR MWGF DCTvarcv DSIFT CNN Our Vegetables 4.663 4.728 7 4.756 5 4.709 6 4.770 4 4.758 6 Tree 3.327 4 5.021 8 5.418 4 5.215 6 4.563 9 5.401 8 A globe 4.967 6.277 1 6.41 6.334 8 5.640 9 6.468 5 The bottle 3.956 4 5.358 5.652 7 5.404 6 4.856 7 5.698 2 -
[1] LIU S, CHEN J, RAHARDJA S. A new multi-focus image fusion algorithm and its efficient implementation[C]//IEEE Transactions on Circuits and Systems for Video Technology. USA: IEEE, 2019.
[2] LIU Yu, LIU Shuping, WANG Zengfu. Multi-focus image fusion with dense SIFT[J]. Information Fusion,2015,23:139-155. doi: 10.1016/j.inffus.2014.05.004
[3] SAHU A, BHATEJA V, KRISHN A. Medical image fusion with Laplacian pyramids[C]//2014 International Conference on Medical Imaging, m-Health and Emerging Communication Systems (MedCom). USA:IEEE, 2014: 448-453.
[4] CHAI Yi, LI Huafeng, ZHANG Xiaoyang. Multifocus image fusion based on features contrast of multiscale products in nonsubsampled contourlet transform domain[J]. Optik-International Journal for Light and Electron Optics,2012,123(7):569-581. doi: 10.1016/j.ijleo.2011.02.034
[5] ZHOU Zhiqiang, LI Sun, WANG Bo. Multi-scale weighted gradient-based fusion for multi-focus images[J]. Information Fusion,2014,20:60-72. doi: 10.1016/j.inffus.2013.11.005
[6] LI Hui, WU Xiaojun, DURRANI T. Multi-focus noisy image fusion using low-rank representation[C]. USA: arXiv.2018: 1804. 09325.
[7] JOSHI K, KIROLA M, CHAUDHARY S, et al. Multi-focus image fusion using discrete wavelet transform method[J/OL]. SSRN, 2009: 3383141[2019-10-12]. https://ssrn.com/abstract=3383141.
[8] DU C B, GAO S S, LIU Y, et al. Multi-focus image fusion using deep support value convolutional neural network[J]. Optik,2019,176:567-578. doi: 10.1016/j.ijleo.2018.09.089
[9] LI H, NIE R, ZHOU D, et al. Proceedings of the 2018 2nd International Conference on Algorithms, Computing and Systems, ICACS '18Convolutional Neural Network Based Multi-Focus Image Fusion[C].[S.l.]: [s.n.] 2018: 148-154.
[10] AMIN-NAJI M, AGHAGOLZADEH A, EZOJI M. Ensemble of CNN for multi-focus image fusion[J]. Information Fusion,2019,51:201-214. doi: 10.1016/j.inffus.2019.02.003
[11] GUO Xiaopeng, NIE Rencan, CAO Jinde, et al. Fully convolutional network-based multifocus image fusion[J]. Neural Computation,2014,30(7):1-26.
[12] 陈清江, 张雪. 基于全卷积神经网络的图像去雾算法[J]. 应用光学,2019,40(4):596-602. CHEN Qingjiang, ZHANG Xue. Image defogging algorithms based on multiscale convolution neural network[J]. Journal of Applied Opties,2019,40(4):596-602.
[13] SIMONYAN K, ZISSERMAN A. Very deep convolutional networks for large-scale image recognition[J]. arXiv preprint arXiv,2014:1409-1556.
[14] LI J, YUAN G, FAN H. Multifocus image fusion using wavelet-domain-based deep CNN[J]. Computational Intelligence and Neuroscience,2019,2019:1-23.
[15] 陈清江, 李毅, 柴昱洲. 一种基于深度学习的多聚焦图像融合算法[J]. 激光与光电子学进展,2018,55(7):246-254. CHEN Qingjiang, LI Yi, CHAI Yuzhou. A multi-focus image fusion algorithm based on deep learning[J]. Laser & Optoelectronics Progress,2018,55(7):246-254.
[16] QIU X, LI M, ZHANG L, et al. Guided filter-based multi-focus image fusion through focus region detection[J]. Signal Processing: Image Communication,2019,72:35-46. doi: 10.1016/j.image.2018.12.004
[17] HAGHIGHAT M B A, AGHAGOLZADEH A, SEYEDARABI H. Multi-focus image fusion for visual sensor networks in DCT domain[J]. Computers & Electrical Engineering,2011,37(5):789-797.
-
期刊类型引用(7)
1. 谢一博,刘卫国,周顺,李梦晗. 基于显著性的双鉴别器GAN图像融合算法. 应用光学. 2024(01): 107-117 . 本站查看
2. 张华,肖莹,孙海森. 基于改进FAST的电力工程图纸识别与校核技术. 电子设计工程. 2024(10): 186-190 . 百度学术
3. 刘丽丽,赵玉. 多聚焦图像焦深扩展分解融合算法仿真. 计算机仿真. 2023(04): 195-198+218 . 百度学术
4. 黄西莹,王洁,王娇颖,闫丽,陆阳,李良福. 多源图像融合算法实时优化方法. 应用光学. 2022(04): 676-681 . 本站查看
5. 邬开俊,梅源. VAE-Fuse:一种无监督的多聚焦融合模型. 西安电子科技大学学报. 2022(06): 129-138 . 百度学术
6. 李诚,刘昊,蒋希峰,吴军法,韩文刚,高建国. 基于VGG网络的发电机定转子智能诊断算法. 电子科技. 2021(11): 62-66 . 百度学术
7. 王兰. 计算机智能技术的船舶图像融合方法. 舰船科学技术. 2020(18): 70-72 . 百度学术
其他类型引用(15)