Print

发布时间: 2021-01-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.200509
2021 | Volume 26 | Number 1




    自动驾驶场景感知与仿真    




  <<上一篇 




  下一篇>> 





Edge-guided GAN:边界信息引导的深度图像修复
expand article info 刘坤华1, 王雪辉1, 谢玉婷1, 胡坚耀2
1. 中山大学数据科学与计算机学院无人系统研究所, 广州 510006;
2. 工业和信息化部电子第五研究所, 广州 510610

摘要

目的 目前大多数深度图像修复方法可分为两类:色彩图像引导的方法和单个深度图像修复方法。色彩图像引导的方法利用色彩图像真值,或其上一帧、下一帧提供的信息来修复深度图像。若缺少相应信息,这类方法是无效的。单个深度图像修复方法可以修复数据缺失较少的深度图像。但是,无法修复带有孔洞(数据缺失较大)的深度图像。为解决以上问题,本文将生成对抗网络(generative adversarial network,GAN)应用于深度图像修复领域,提出了一种基于GAN的单个深度图像修复方法,即Edge-guided GAN。方法 首先,通过Canny算法获得待修复深度图像的边界图像,并将此两个单通道图像(待修复深度图像和边界图像)合并成一个2通道数据;其次,设计Edge-guided GAN高性能的生成器、判别器和损失函数,将此2通道数据作为生成器的输入,训练生成器,以生成器生成的深度图像(假值)和深度图像真值为判别器的输入,训练判别器;最终得到深度图像修复模型,完成深度图像修复。结果 在Apollo scape数据集上与其他4种常用的GAN、不带边界信息的Edge-guided GAN进行实验分析。在输入尺寸为256×256像素,掩膜尺寸为32×32像素情况下,Edge-guided GAN的峰值信噪比(peak signal-to-noise ratio,PSN)比性能第2的模型提高了15.76%;在掩膜尺寸为64×64像素情况下,Edge-guided GAN的PSNR比性能第2的模型提高了18.64%。结论 Edge-guided GAN以待修复深度图像的边界信息为其修复的约束条件,有效地提取了待修复深度图像特征,大幅度地提高了深度图像修复的精度。

关键词

生成对抗网络; 深度图像修复方法; Edge-guided GAN; 边界信息; Apollo scape数据集

Edge-guided GAN: a depth image inpainting approach guided by edge information
expand article info Liu Kunhua1, Wang Xuehui1, Xie Yuting1, Hu Jianyao2
1. Institute of Unmanned Systems, School of Data and Computer Science, Sun Yat-sen Univercity, Guangzhou 510006, China;
2. The Fifth Electronics Research Institute of Ministry of Industry and Information Technology, Guangzhou 510610, China
Supported by: National Key Research and Development Program of China (2018YFB1305002); National Natural Science Foundation of China (62006256); Fundamental Research Funds for the Central Universities (67000-31610134)

Abstract

Objective Depth images play an important role in robotics, 3D reconstruction, and autonomous driving. However, depth sensors, such as Microsoft Kinect and Intel RealSense, produce depth images with missing data. In some fields, such as those using high-dimension maps for autonomous driving (including RGB images and depth images), objects not belonging to these maps (people, cars, etc.) should be removed. The corresponding areas are blank (i.e., missing data) after removing objects from the depth image. Therefore, depth images with missing data should be repaired to accomplish some 3D tasks. Depth image inpainting approaches can be divided into two groups: image-guided depth image inpainting and single-depth image inpainting approaches. Image-guided depth image inpainting approaches repair depth images through information on the ground truth of its color images or its previous frames or its next frames. Without this information, these approaches are useless. Single-depth image inpainting approaches cannot repair images without any information from other color images. Currently, only a few studies have tackled this issue by using and improving depth low-rank components in depth images. Current single-depth image inpainting methods only repair depth images with sparse missing data rather than small or large holes. Generative adversarial network (GAN)-based approaches have been widely researched for RGB image inpainting and have achieved state-of-the-art (SOTA) results. However, to the best of our knowledge, no GAN-based approach is reported for depth image inpainting. The reasons are as follows. On the one hand, the depth image records the distance between different objects and lacks texture information. Some researchers have expressed concerns about whether convolutional neural networks (CNNs) can extract depth image features well due to this characteristic. On the other hand, no public depth image datasets are available for CNN-based approaches to train. For the first reason, CNNs have been verified that they can extract features of depth images. For the second reason, the Baidu company released the Apollo scape dataset in 2018 that contains 43 592 depth ground truth images. These images are sufficient to explore the GAN-based approach for depth image inpainting. Therefore, we explore a single-depth image inpainting approach. Method In this paper, we provided a GAN called edge-guided GAN for depth image inpainting. We first obtained the edge image of the deficient depth image by using the Canny algorithm and then combined the deficient depth image and its edge image into two-channel data. These data are used as inputs to the edge-guided GAN, and the output is the repaired depth image. The edge image presents the edge information of a deficient depth image that guides inpainting. The edge-guided GAN contains a generator and a discriminator. The generator is an encoder-decoder architecture and is designed for depth image inpainting. This generator first uses two asymmetric convolutional network(ACNet) layers and six residual block layers to extract depth image features and then utilizes two convolution transpose layers to generate a repaired depth image. ACNet can be trained to achieve a better performance than standard square-kernel convolutional layers but only uses less GPU memory. The discriminator uses repaired depth images or the ground truth of depth images as inputs and predicts whether the inputs are true or fake depth images. The architecture of the discriminator is similar to that of PatchGAN and contains five stand convolution layers. The loss functions of generator and a discriminator are designed. The input of the discriminator includes the ground truth of the depth image and the depth image generated by the generator. The discriminator loss can be separated into two categories. When the inputs are ground truth, the discriminator loss is the binary cross entropy (BCE) loss of its results with one. When the inputs are the generated depth image, the discriminator loss is the BCE loss of its results with zero. Therefore, the total loss of the discriminator is the average of the sum of the above two losses. The loss function of generator is the average of L1 loss between the pixels of deficient depth image and the pixels of depth image after inpainting. The optimization goal of edge-guided GAN is to minimize the generator loss and maximize the discriminator loss. Result We trained four commonly used methods and edge-guided GAN without edge information for comparison to verify the performance of our edge-guided GAN. When the size of input is 256×256 pixels and the size of mask is 32×32 pixels, the peak signal to noise ratio of edge-guided GAN is 35.250 8. Compared with the second performance method, the peak signal-to-noise ratio (higher is better) increases by 15.76%. When the size of mask is 64×64, the peak signal-to-noise ratio of edge-guided GAN is 29.157 3. Compared with the second method, the peak signal-to-noise ratio increases by 18.64%. The peak signal-to-noise ratios of all methods with 32×32 masks are higher than the corresponding methods with 64×64 masks. We conducted an experiment to verify the performance of edge-guided GAN on object removal. In this experiment, the objects that need to be removed were set as mask, and the edge-guided GAN achieved SOTA results. Conclusion The proposed edge-guided GAN is a single-depth image inpainting approach with high accuracy. This method takes the edge information of deficient depth image as the constraint condition, and its architecture and loss functions can effectively extract the features of deficient depth image.

Key words

generative adversarial network(GAN); depth image inpainting approaches; Edge-guided GAN; edge information; the Apollo scape dataset

0 引言

深度图像,又名距离图像,即存储从图像采集器到场景中各点距离的图像。目前深度图像已经广泛应用于机器人(王斌,2019张米令,2018殷剑文,2018)、自动驾驶(Tateno等,2017Grinvald等,2019Aleotti等,2020Huang等,2020Tian等,2020)等领域。然而,在深度图像的应用过程中,直接获取的深度图像一般不能满足需求,需要对其进一步处理。例如,当使用微软Kinect和英特尔RealSense等深度传感器获取深度图像时,会产生缺少数据的深度图像,使用前需要对其进行修复;在高精地图等研究方向,不属于高精地图的对象(人、汽车等)应该被移除,并对移除对象后的深度图像进行修复。

目前深度图像修复方法主要分为两类:色彩图像引导的深度图像修复方法和单个深度图像修复方法。色彩图像引导的深度图像修复方法通过待修复深度图像的彩色图像真值,或其上一帧、下一帧的信息来修复深度图像。此类方法可以取得较好的修复效果,但是具有一定的局限性。例如:如果没有待修复深度图像的彩色图像真值,或其上一帧、下一帧的信息,这种方法是无用的。单个深度图像修复方法是在没有其他信息的情况下对深度图像进行修复的方法。该类方法(Candès和Recht,2009Shi等,2013Xue等,2017)主要通过在深度图像中使用和改进深度低阶分量来实现深度图像的修复。由于单个深度图像修复方法没有其他信息的辅助,现有的单个深度图像修复方法可以修复缺失数据稀疏的深度图像,但是不能修复具有较大遮挡(掩膜)的深度图像(图 1,输入数据的尺寸是256×256像素,掩膜的尺寸为32×32像素)。由于目前此类研究较少, 本文对最近的单个深度图像修复方法(Candès和Recht,2009Shi等,2013Xue等,2017)进行了实验。

图 1 已存在的单个深度图像修复方法的修复效果
Fig. 1 Results of current single-depth image inpainting approaches ((a) deficient depth image; (b)mask; (c)ground truth; (d)Candès and Recht (2009); (e)Shi et al. (2013); (f)Xue et al. (2017))

针对以上问题,本文基于深度学习理论,研究可以修复较大遮挡的单个深度图像修复方法。生成对抗网络(generative adversarial network,GAN)是Goodfellow等人(2014)提出的一个编码解码框架。近年来,基于GAN的色彩图像修复方法得到了广泛的研究,并取得了显著的成果。然而,目前还没有基于GAN的深度图像修复方法。本文分析其原因如下:

1) 深度图像记录了不同物体之间的距离,缺少纹理信息。由于这一特性,卷积神经网络(convolutional neural network,CNN)不确定能否很好地提取深度图像特征。

2) 对于基于CNN的训练方法,没有公开的深度图像数据集。

然而,对于原因1),Han等人(2019b)成功地利用Deep-Q-Network(Mnih等,2013)和CNN实现了深度图像的修复,验证了CNNs能够提取深度图像的特征。对于原因2),百度公司在2018年发布了Apollo scape数据集,其中包含43 592幅深度地面真实图像。这些图像足以探索基于GAN的深度图像修复方法。

因此,本文探索GAN应用于深度图像修复的方法,提出了Edge-guided GAN, 其以待修复图像及其边界图像为输入,通过生成器提取深度图像特征,并生成修复后的深度图像。本文的主要贡献为首创性地把GAN应用到深度图像修复,提出了Edge-guided GAN,设计了其架构及损失函数。

1 相关工作

1.1 深度图像修复方法

1.1.1 色彩图像引导的深度图像修复方法

Liu等人(2012)在快速推进方法(Telea,2004)的启发下,提出了一种色彩图像引导深度图像修复方法,并应用边界保持引导滤波器来降低噪声。Herrera等人(2013)提出了使用色彩图像来指导修复并对齐颜色和深度边界的深度图像修复方法。Chen等人(2014)提出了一种深度辅助边界检测算法,该算法利用色彩图像和原始深度数据提取初始边界,并用于辅助深度图修复。Zhang等人(2018)提出了一种图像引导的深度超分辨率框架,该框架首先采用轮廓引导的快速行进方法对原始深度图像进行预处理,然后通过凸优化模型将深度图像处理为高分辨率图像。Zhang等人(2018)通过从颜色预测表面法向量,然后求解完成的深度,来填充RGB-D图像深度通道中的大面积缺失区域。

综上所述,图像引导深度图像修复是通过彩色图像和前一帧或下一帧的信息来修复深度图像。没有这些信息,这些方法是无用的。

除上述方法外,Han等人(2019b)提供了一个额外的3D全局环境,指导对不同视图的修复,以获得更准确和一致的输出。虽然这种深度图像的方法不是以色彩图像为指导,但它是由3维全局上下文指导。当没有4维全局上下文信息时,该方法也是无用的。

1.1.2 单一深度图像修复方法

与色彩图像引导的深度图像修复方法相比,单一深度图像修复方法不需要除待修复深度图像外的其他信息。Candès和Recht(2009)将图像视为矩阵,采用低秩正则化方法对图像进行修复。然而,低秩正则化考虑的是全局性的信息,并没有很好地考虑局部空间一致性。因此,低秩假设没有考虑图像的最佳特性,其修复效果不佳。为了解决这个问题,Shi等人(2013)提出了一种替代方法——低秩全变差方法,它将同时(全局)低秩正则化与(局部)全变差正则化结合起来。为了在惩罚非零梯度的同时减少对梯度1的惩罚,Xue等人(2017)提出了一种低梯度正则化方法,将低秩正则化与低秩低梯度方法相结合,用于深度图像修复。

以上单个深度图像修复方法可以修复具有稀疏缺失数据的深度图像,但是却不能修复具有较大遮挡(掩膜)的深度图像(图 1)。针对此问题,本文提出了Edge-guided GAN。

1.2 生成对抗网络(GAN)

自2014年GAN(Goodfellow等,2014)被提出以来,就得到了学者们广泛的研究。目前其已经在图像处理领域(图像分类(Zhu等,2018)),数据增强(Han等,2019a),图像到图像转换(Isola等,2017), 高分辨率图像合成和语义操作(Wang等,2018),细粒度文本到图像生成(Xu等,2017),图像修复(Pathak等,2016Wang等,2019))和NLP(natural language processing)(Yu等,2017Li等,2017Yang等,2017)等领域取得了显著的成绩(为符合读者的常用语,本文中没有特殊说明的“图像”均指“色彩图像”)。

第1个图像修复的GAN是上下文编码器(Pathak等,2016),其使用编码器作为生成器(generator,G),解码器作为判别器(discriminator,D)。但是,由于存在全连接层,输出图像的恢复区域呈现出模糊性。为了解决这一问题,学者们提出了许多基于上下文编码器的图像修复GAN(Iizuka等,2017Liu等,2018; Liu等,2019Yu等,2018Nazeri等,2019Yan等,2018)。图像的修复效果也得到了大幅度提高。Iizuka等人(2017)提出了一种图像修复方法,该方法能够修复局部和全局一致的图像。为了保持一致性,设计了全局和局部上下文鉴别器。具体而言,全局鉴别器的设计是为了确保整个图像的一致性,而局部鉴别器的设计是为了确保生成的补丁的局部一致性。Liu等人(2018)发现,用于图像修复的标准卷积网络可能会导致诸如颜色差异和模糊等伪影。因此,在Liu等人(2018)的方法中用部分卷积代替标准卷积。

针对CNN引起的结构扭曲或纹理模糊等问题,Yu等人(2018)提出了一种基于深层生成器的上下文关注方法,在图像合成过程中,不仅可以利用传统的纹理预测方法,而且可以更好地利用周围的纹理特征进行图像合成。Nazeri等人(2019)提出一个两阶段对抗模型EdgeConnect。针对CNN引起的纹理模糊问题,Yan等人(2018)在提出的U-Net体系结构中引入了一种特殊的移位连接层;其将已知区域的编码器特征移位以作为缺失部分的估计;在译码器特征上引入引导损耗,使全连通层后的解码器特征与缺失部分的地面真值编码器特征之间的距离最小;该方法可以用于填补缺失具有尖锐结构和精细纹理的任何形状的区域。Liu等人(2019)认为修复后的图像会产生纹理模糊,结构扭曲的原因为局部像素的不连续性,因此,Liu等人(2019)从语义层面分析了这一问题,提出了一种基于深层生成器的精确方法,该方法采用了一种新颖的相干语义注意层,可以对空洞特征之间的语义关联进行建模,此方法不仅可以保持上下文结构,而且可以更有效地预测缺失部分。

2 Edge-guided GAN

Edge-guided GAN的设计思路来自用于色彩图像修复的EdgeConnect(Nazeri等,2019)。EdgeConnect为一个两阶段的色彩图像修复模型;其首先修复色彩图像的边界图像,然后使用边界图像作为色彩图像修复的约束信息;以待修复色彩图像和边界图像为输入,完成色彩图像的修复。与EdgeConnect相同的是:Edge-guided GAN也使用边界信息作为修复的约束信息。与EdgeConnect不同的是:1)EdgeConnect的研究对象为色彩图像,本文的研究对象为深度图像;2)EdgeConnect使用修复后的边界图像为约束信息,本文使用深度图像的边界图像为约束信息;3)EdgeConnect为两阶段的对抗模型,训练过程复杂, 本文为一阶段的对抗模型,训练过程简单。

2.1 Edge-guided GAN架构

Goodfellow等人(2014)提出的GAN结构类似,本文提出的Edge-guided GAN(图 2)也包含生成器G和判别器D两部分。生成器G的目的是使模拟的样本分布接近真实数据分布,使生成的待修复深度图像接近于深度图像真值。为提高生成器G提取特征和表达特征的能力,本文设计生成器G为一种编码—解码结构;其编码结构包括5个ACNet(Ding等,2019)层和6个空洞卷积层;解码结构为5个卷积转置层(Yan等,2018)。其中,ACNet是由Ding等人(2019)提出的一种卷积结构,它可以训练成比标准的方核卷积层更好的性能,但占用较少GPU内存。生成器G的输入为待修复深度图像及其边界图像;具体来讲,待修复深度图像与其边界图像通过拼接操作组合成新的数据;边界图像为对待修复图像通过Canny算法(Canny,1986)计算后的结果。生成器G的输出为修复后的深度图像。

图 2 Edge-guided GAN的流程图
Fig. 2 The pipline of edge-guided GAN

判别器D的目的为判断哪些是深度图像真值,哪些是生成器G得到的修复后深度图像;把判断结果反馈给生成器G,从而达到提高生成器G生成修复后深度图像精度的目的。为提高判别器D提取深度图像特征的能力,本文设计判别器D的结构与PatchGAN(Zhu等,2018)的结构相似。两者均包含5个标准卷积层,但是具有不同的参数。判别器D的输入为深度图像真值和生成器G得到的修复后深度图像,其输出为对输入是否真值的判断结果。

2.2 Edge-guided GAN损失函数

损失函数的设计对于神经网络模型是否收敛或者能否取得较好的精度具有举足轻重的作用。Edge-guided GAN包括生成器G和判别器D。因此,其损失函数包括生成器G的和判别器D的损失函数。

判别器D的输出为对深度图像真值和生成器G得到的修复后深度图像是否真值的判断结果,具体来讲,其输出结果为是否为真值的概率矩阵(0~1)。本文期望深度图像真值通过判别器D后概率矩阵的值越来越接近1,即表明其为深度图像真值(标签值为1的矩阵,矩阵大小与输出矩阵的大小相同);相反,修复后的深度图像真值通过判别器D后概率矩阵的值越来越接近0,即表明其为深度图像假值(标签值0的矩阵,矩阵大小与输出矩阵的大小相同)。因此,本文设计判别器对抗损失函数为判别器输出与其对应标签的BCE(binary cross entropy)损失(Pan等,2018)。

由于判别器D的输入包括深度图像真值和生成器G得到的修复后深度图像2种类型,且深度图像真值标签为数值为1的矩阵,假值标签为数值为0的矩阵。因此,判别器的损失函数也包括两种情况:

1) 判别器D的输入为深度图像真值时,其损失函数为判别器D输出与矩阵深度图像真值标签的BCE损失;

2) 判别器D的输入为生成的深度图像时,其损失函数为判别器D输出与矩阵深度图像假值标签的BCE损失。

由于判别器D的输入深度图像真值和修复后的深度图像数据量比例为1 :1,因此,本文设计判别器的损失为以上两种损失和的平均值。令判别器D的损失为${L_{{\rm{ad}}}}$,判别器D的输入为深度图像真值时的输出为${{D_{{\rm{re}}}}}$,判别器D的输入为生成的深度图像时的输出为${{D_{{\rm{fa}}}}}$,BCE损失为${BCEloss\left(\cdot \right)}$,判别器D的损失函数可以表示为

$ {L_{{\rm{ad}}}} = \frac{{BCEloss\left({{D_{{\rm{re}}}}, 1} \right) + BCEloss\left({{D_{{\rm{fa}}}}, 1} \right)}}{2} $ (1)

生成器G的输入数据为待修复的深度图像及其边界图像,其中待修复的深度图像为1维的灰度图像,其数据范围为(0,255);边界图像为1维的灰度图像,其数据值为0或255;输出数据也为1维的灰度图像,其数据范围为(0,255)。因此,本文设计生成器G的损失函数为待修复深度图像的像素与修复后深度图像像素的L1损失的平均值。令修复后的深度图像像素值为${D_{{\rm{pr}}}^i}$,待修复的深度图像像素值为${\tilde D_{\rm{T}}^i}$,生成器G损失为${L_{{\rm{ge}}}}, N$为图像像素总数,生成器G的损失函数可以表示为

$ {L_{{\rm{ge}}}} = \frac{1}{N}\left({\sum\limits_{i = 1}^N {{{\left\| {\tilde D_{\rm{T}}^i - D_{{\rm{pr}}}^i} \right\|}_1}} } \right) $ (2)

为最大化深度图像的修复效果,Edge-guided GAN的优化目标为最小化生成器损失,同时最大化对抗损失。令优化目标为${L_G}$, Edge-guided GAN的目标函数可以表示为

$ \mathop {\min }\limits_G \mathop {\max }\limits_D {L_G} = \mathop {\min }\limits_G \left({\alpha \mathop {\max }\limits_D {L_{{\rm{ad}}}} + \beta {L_{{\rm{ge}}}}} \right) $ (3)

式中,$\alpha $$\beta $分别为${{L_{{\rm{ad}}}}}$${{L_{{\rm{ge}}}}}$的参数,其参数设计参考对此算法(Nazeri等,2019),分别为1和0.1。

3 实验验证

3.1 实验参数设置

本文使用Apollo scape数据集(Huang等,2018)训练和测试了Edge-guided GAN。Apollo scape数据集是百度公司于2018年公开的一个自动驾驶领域的数据集,其提供了不同城市、不同交通条件下的146 997个视频帧及其像素级、实例级注释和静态背景的姿态信息与深度图。为了测试Edge-guided GAN的泛化能力,本文设计road 01和road 03的Camera 5作为训练数据;road 02的Camera 5作为验证数据;road 04的Camera 5作为测试数据。生成器G前6层的激活函数为ReLU(Nair和Hinton,2010);第7层的激活函数为sigmoid;判别器D前4层的激活函数为LeReLU(Maas等,2013),其参数为0.25;最后一层的激活函数为sigmoid;优化算法为Adam(Kingma和Ba,2017);训练循环数目为100。Edge-guided GAN的架构参数见表 1表 2

表 1 生成器G的参数
Table 1 Parameters of G

下载CSV
输入 卷积核 步长 填充
Conv_1 [7×7,64] 1 3
Conv_2 [4×4,128] 2 1
Conv_3 [4×4,256] 2 1
Conv_4 [3×3,256] 1 1
Conv_5 [4×4,128] 2 1
Conv_6 [4×4,64] 2 1
Conv_7 [7×7,3] 1 3

表 2 判别器D的参数
Table 2 Parameters of D

下载CSV
输入 卷积核 步长 填充
Conv1 [4×4,64] 2 1
Conv2 [4×4,128] 2 1
Conv3 [4×4,256] 2 1
Conv4 [4×4,512] 1 1
Conv5 [4×4,1] 1 1

3.2 实验结果

3.2.1 与其他模型的定性比较

由于目前没有有效的单个深度图像修复方法(图 1),本文以近期在色彩图像修复领域取得显著修复效果的GAN(Pathak等,2016Iizuka等,2017Liu等,2018Liu等,2019)为基准,对Edge-guided GAN进行对比实验。训练时,每个实验输入图像和掩膜的尺寸分别为256×256像素和64×64像素,所有掩膜均为随机生成。

为进一步验证模型的泛化能力,测试时掩膜大小分别为输入尺寸的1/4×1/4(大小为64×64像素)和1/8×1/8(大小为32×32像素)。各模型的定性比较结果如图 3所示。由图 3可知,无论是对32×32像素的掩膜还是64×64像素的掩膜,Edge-guided GAN都可以更好地提取深度图像的边界特征,获得比其他算法(Liu等,2018Pathak等,2016Iizuka等,2017Liu等,2019)更精确的修复效果。

图 3 定性比较结果
Fig. 3 Qualitative comparison results ((a) deficient depth image; (b)mask; (c) Liu et al.(2019); (d) Iizuka et al. (2017); (e) Pathak et al. (2016); (f) Liu et al. (2018); (g) Edge_guided GAN; (h) ground truth)

此外,在相同的参数下,每个模型在32×32像素掩膜的修复效果均优于64×64像素掩膜的修复效果。即当遮挡物体尺寸较小时,其修复效果优于遮挡物体尺寸较大时的修复效果。

3.2.2 与不带边界信息的Edge-guided GAN的定性比较

为了验证待修复深度图像边界信息在深度图像修复中的作用,设计了一组对比实验。一个实验的输入与Edge-guided GAN的输入相同(待修复深度图像及其掩膜),另一个实验的输入仅为待修复的深度图像。实验的其他参数与3.1节实验参数设置相同;训练时掩膜尺寸为64×64像素;测试时掩膜尺寸分别为32×32像素,64×64像素。该实验的部分结果如图 4所示。由图 4可知,无论掩模尺寸是32×32像素,还是64×64像素,Edge-guided GAN的修复效果均优于不带边界信息的Edge-guided GAN。另外,在相同的参数下,掩膜尺寸32×32像素的修复效果均优于掩膜尺寸64×64像素的修复效果。

图 4 与不带边界信息的Edge-guided GAN定性比较结果
Fig. 4 Qualitative comparison results with edge-guided GAN which are without edge information ((a) deficient depth image; (b)mask; (c) Edge-guided GAN without edge information; (d) Edge-guided GAN; (e) ground truth)

3.2.3 定量比较

除以上定性比较外,本文也对以上模型的测试结果进行了定量比较。峰值信噪比(peak signal-to-noise ratio,PSNR)是图像领域常用的比较图像质量的指标,因此,本文也计算了以上模型得到的修复后图像与其真值图像的PSNR。各模型的PSNR比较结果如表 3所示。

表 3 峰值信噪比(PSNR)比较结果
Table 3 PSNR comparison results

下载CSV
模型 掩膜尺寸
/像素
PSNR
/dB
Liu等人(2018) 32×32 16.468 7
Liu等人(2018) 64×64 15.396 5
Pathak等人(2016) 32×32 25.820 3
Pathak等人(2016) 64×64 21.493 3
Iizuka等人(2017) 32×32 23.865 6
Iizuka等人(2017) 64×64 14.129 1
Liu等人(2019) 32×32 30.452 0
Liu等人(2019) 64×64 24.576 1
不带边界信息的Edge-guided GAN 32×32 28.731 2
不带边界信息的Edge-guided GAN 64×64 22.004 7
Edge-guided GAN 32×32 35.250 8
Edge-guided GAN 64×64 29.157 3
注:加粗字体表示最优结果。

表 3可知,在32×32像素掩膜时,Edge-guided GAN取得的PSNR为35.250 8,优于同等条件下的对比算法(Pathak等,2016Iizuka等,2017Liu等,2018; Liu等,2019)和不带边界信息的Edge-guided GAN;且比性能第2的模型(Liu等,2019)提高了15.76%。在64×64像素掩膜时,Edge-guided GAN取得的PSNR为29.157 3 dB,优于同等条件下的对比算法(Pathak等,2016Iizuka等,2017Liu等,2018; Liu等,2019)和不带边界信息的Edge-guided GAN;且比性能第2的模型(Liu等,2019)提高了18.64%。

此外,所有模型在32×32像素掩膜时,得到的PSNR均优于其在64×64像素掩膜时得到的PSNR。PSNR结果与定性比较结果相同,证明了Edge-guided GAN可以有效地完成深度图像修复;同时,也意味着图像的边界有助于Edge-guided GAN提取图像特征。

3.3 实验分析

3.3.1 Edge-guided GAN用于目标物移除

Edge-guided GAN除了可以实现深度图像修复外,还可以实现深度图像的目标物移除。在实现深度图像的目标物移除时,目标物(人、车等)被提取作为掩膜。为了验证Edge-guided GAN以实现深度图像的目标物移除,本文以Apollo scape(Huang等,2018)为数据集,基于其深度图像真值和目标物标签,生成待修复深度图像,并对其进行了实验验证。

具体而言,Apollo scape数据集的road 01和road 03的Camera 5作为训练数据;road 02的Camera 5作为验证数据;road 04的Camera 5作为测试数据。模型训练和测试过程中,待修复图像大小为256×256像素。Edge-guided GAN的参数与表 1表 2相同。一些实验测试结果如图 5所示。由图 5可知,Edge-guided GAN可以高精度地实现深度图像目标物移除。

图 5 Edge-guided GAN用于目标物移除任务
Fig. 5 Edge-guided GAN for object removal ((a) deficient depth image; (b)mask; (c) Edge-guided GAN; (d) ground truth)

3.3.2 Edge-guided GAN用于过大掩膜时的修复

与4个常用GAN(Pathak等,2016Iizuka等,2017Liu等,2018; Liu等,2019)的对比实验表明:Edge-guided GAN可以有效地修复遮挡区域为输入尺寸1/4×1/4(64×64像素)和输入尺寸1/8×1/8(32×32像素)的深度图像。但是没有表明其对更大遮挡(掩膜)区域的修复效果。因此,设计了Edge-guided GAN修复大遮挡区域(输入尺寸的1/2×1/2)的实验。

在该实验中,本文设计Apollo scape数据集(Huang等,2018)的road 01和road 03的Camera 5作为训练数据;road 02的Camera 5作为验证数据;road 04的Camera 5作为测试数据;设定大遮挡区域的尺寸为输入尺寸的1/2×1/2(128×128像素)。除此之外,实验的其余参数均与第3.1节相同。实验结果表明:对于掩膜区域为输入尺寸1/2×1/2(128×128像素)的深度图像,Edge-guided GAN的修复效果明显低于掩膜区域为输入尺寸1/4×1/4(64×64像素)和输入尺寸1/8×1/8(32×32像素)的修复效果(图 6)。即:Edge-guided GAN对于大遮挡区域的修复效果较差。

图 6 当掩膜为128×128像素时的定性比较结果
Fig. 6 Qualitative results with 128×128 pixels masks ((a) deficient depth image; (b)mask; (c) Edge-guided GAN; (d) ground truth)

4 结论

针对深度图像修复问题,本文提出了一种用于深度图像修复的生成对抗网络:Edge-guided GAN。该方法以待修复深度图像的边界信息为其修复的约束条件,通过高性能的网络架构和损失函数提取和表达待修复深度图像的特征,从而实现其高精度修复的目的。为验证Edge-guided GAN的性能,本文基于Apollo scape数据集,与其他4种常用的GAN、不带边界的Edge-guided GAN进行了实验验证。实验结果表明:无论对于输入尺寸为1/4×1/4的掩膜,还是输入尺寸为1/8×1/8的掩膜,Edge-guided GAN的修复效果均明显优于性能第2的修复方法。Edge-guided GAN可以有效地提取深度图像特征,并修复输入尺寸为1/4×1/4和输入尺寸为1/8×1/8的掩膜。此外,基于Apollo scape数据集的目标移除实验表明:Edge-guided GAN可以高精度地实现深度图像目标物移除。但是,当掩膜尺寸为输入尺寸的1/2×1/2时,Edge-guided GAN的修复效果下降。分析其原因,本文认为当掩膜尺寸为输入尺寸1/2×1/2时,深度图像被遮挡的区域过大,Edge-guided GAN可以提取的有效特征较少,所以导致修复效果下降。未来计划探索一种更好的卷积结构来提取深度图像特征,提高深度图像修复精度。

参考文献

  • Aleotti F, Zaccaroni G, Bartolomei L, Poggi M, Tosi F and Mattoccia S. 2020. Real-time single image depth perception in the wild with handheld devices[EB/OL].[2020-06-10]. https://arxiv.org/pdf/2006.05724.pdf
  • Candès E J and Recht B. 2009. Exact matrix completion via convex optimization. Foundations of Computational mathematics, 9(6): 717-772[DOI:10.1007/s10208-009-9045-5]
  • Canny J. 1986. A computational approach to edge detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 8(6): 679-698[DOI:10.1109/TPAMI.1986.4767851]
  • Chen W H, Yue H S, Wang J H and Wu X M. 2014. An improved edge detection algorithm for depth map inpainting. Optics and Lasers in Engineering, 55: 69-77[DOI:10.1016/j.optlaseng.2013.10.025]
  • Ding X H, Guo Y C, Ding G G and Han J G. 2019. AcNet: strengthening the kernel skeletons for powerful CNN via asymmetric convolution blocks[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1908.03930v3.pdf
  • Goodfellow I J, Pouget-Abadie J, Mirza M, Xu B, Warde-Farley D, Ozair S, Courville A and Bengio Y. 2014. Generative adversarial nets[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1406.2661.pdf
  • Grinvald M, Furrer F, Novkovic T, Chung J J, Cadena C, Siegwart R, Nieto J. 2019. Volumetric instance-aware semantic mapping and 3D object discovery. IEEE Robotics and Automation Letters, 4(3): 3037-3044 [DOI:10.1109/LRA.2019.2923960]
  • Han X, Zhang L H, Zhou K, Wang X N. 2019a. ProGAN:protein solubility generative adversarial nets for data augmentation in DNN framework. Computers and Chemical Engineering, 131: #106533 [DOI:10.1016/j.compchemeng.2019.106533]
  • Han X G, Zhang Z X, Du D, Yang M D, Yu J M, Pan P, Yang X, Liu L G, Xiong Z X and Cui S G. 2019b. Deep reinforcement learning of volume-guided progressive view inpainting for 3D point scene completion from a single depth image[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1903.04019.pdf
  • Herrera C D, Kannala J, Ladický L and Heikkilä J. 2013. Depth map inpainting under a second-order smoothness prior//Proceedings of the 18th Scandinavian Conference on Image Analysis. Espoo, Finland: Springer: 555-566[DOI:10.1007/978-3-642-38886-6_52]
  • Huang X Y, Cheng X J, Geng Q C, Cao B B, Zhou D F, Wang P, Lin Y Q and Yang R G. 2018. The apolloscape dataset for autonomous driving//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. Salt Lake City, USA: IEEE: 954-960[DOI:10.1109/CVPRW.2018.00141]
  • Huang Z Y, Lv C, Xing Y and Wu J D. 2020. Multi-modal sensor fusion-based deep neural network for end-to-end autonomous driving with scene understanding[EB/OL].[2020-08-08]. https://arxiv.org/pdf/2005.09202.pdf
  • Iizuka S, Simo-Serra E, Ishikawa H. 2017. Globally and locally consistent image completion. ACM Transactions on Graphics, 36(4): #107 [DOI:10.1145/3072959.3073659]
  • Isola P, Zhu J Y, Zhou T H and Efros A A. 2017. Image-to-image translation with conditional adversarial networks//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA: IEEE: 5967-5976[DOI:10.1109/CVPR.2017.632]
  • Kingma D P and Ba J. 2017. Adam: a method for stochastic optimization[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1412.6980.pdf
  • Li J W, Monroe W, Shi T L, Jean S, Ritter A and Jurafsky D. 2017. Adversarial learning for neural dialogue generation[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1701.06547.pdf
  • Liu G L, Reda F A, Shih K J, Wang T C, Tao A and Catanzaro B. 2018. Image inpainting for irregular holes using partial convolutions//Proceedings of the 15th European Conference on Computer Vision. Munich, Germany: Springer: 89-105[DOI:10.1007/978-3-030-01252-6_6]
  • Liu H Y, Jiang B, Xiao Y and Yang C. 2019. Coherent semantic attention for image inpainting//Proceedings of 2019 IEEE/CVF International Conference on Computer Vision. Seoul, South Korea: IEEE: 4169-4178[DOI:10.1109/ICCV.2019.00427]
  • Liu J Y, Gong X J and Liu J L. 2012. Guided inpainting and filtering for kinect depth maps//Proceedings of the 21st International Conference on Pattern Recognition. Tsukuba, Japan: IEEE: 2055-2058
  • Maas A L, Hannun A Y and Ng A Y. 2013. Rectifier nonlinearities improve neural network acoustic models//Proceedings of the 30th International Conference on Machine Learning. Atlanta, USA: JMLR: #3
  • Mnih V, Kavukcuoglu K, Silver D, Graves A, Antonoglou I, Wierstra D and Riedmiller M. 2013. Playing atari with deep reinforcement learning[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1312.5602.pdf
  • Nair V and Hinton G E. 2010. Rectified linear units improve restricted Boltzmann machines//Proceedings of the 27th International Conference on International Conference on Machine. Haifa, Israel: ICML: 807-814[DOI:10.5555/3104322.3104425]
  • Nazeri K, Ng E, Joseph T, Qureshi F Z and Ebrahimi M. 2019. Edgeconnect: generative image inpainting with adversarial edge learning[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1901.00212.pdf
  • Pan J T, Ferrer C C, McGuinness K, O'Connor N E, Torres J, Sayrol E and Giro-i-Nieto X. 2018. SalGAN: visual saliency prediction with generative adversarial networks[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1701.01081.pdf
  • Pathak D, Krähenbuhl P, Donahue J, Darrell T and Efros A A. 2016. Context encoders: feature learning by inpainting[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1604.07379.pdf
  • Shi F, Cheng J, Wang L, Yap P T and Shen D G. 2013. Low-rank total variation for image super-resolution//Proceedings of the 16th International Conference on Medical Image Computing and Computer-Assisted Intervention. Nagoya, Japan: Springer: 155-162[DOI:10.1007/978-3-642-40811-3_20]
  • Tateno K, Tombari F, Laina I and Navab N. 2017. CNN-SLAM: real-time dense monocular slam with learned depth prediction[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1704.03489.pdf
  • Telea A. 2004. An image inpainting technique based on the fast marching method. Journal of Graphics Tools, 9(1): 23-34 [DOI:10.1080/10867651.2004.10487596]
  • Tian M, Nie Q and Shen H. 2020. 3D scene geometry-aware constraint for camera localization with deep learning[EB/OL].[2020-08-08]. https://arxiv.org/pdf/2005.06147.pdf
  • Wang B. 2019. Research on Robotic Grasping Detecion Based on Depth Image and Deep Learning. Hangzhou: Zhejiang University (王斌. 2019.基于深度图像和深度学习的机器人抓取检测算法研究.杭州: 浙江大学)
  • Wang N, Li J Y, Zhang L F and Du B. 2019. MUSICAL: multi-scale image contextual attention learning for inpainting//Proceedings of the 28th International Joint Conference on Artificial Intelligence. Macao, China: IJCAI: 3748-3754[DOI:10.24963/ijcai.2019/520]
  • Wang T C, Liu M Y, Zhu J Y, Tao A, Kautz J and Catanzaro B. 2018. High-resolution image synthesis and semantic manipulation with conditional GANs[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1711.11585.pdf
  • Xu T, Zhang P C, Huang Q Y, Zhang H, Gan Z, Huang X L and He X D. 2017. AttnGAN: fine-grained text to image generation with attentional generative adversarial networks[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1711.10485.pdf
  • Xue H Y, Zhang S M, Cai D. 2017. Depth image inpainting:improving low rank matrix completion with low gradient regularization. IEEE Transactions on Image Processing, 26(9): 4311-4320 [DOI:10.1109/TIP.2017.2718183]
  • Yan Z Y, Li X M, Li M, Zuo W M and Shan S G. 2018. Shift-net: image inpainting via deep feature rearrangement//Proceedings of the 15th European Conference on Computer Vision. Munich, Germany: Springer: 3-19[DOI:10.1007/978-3-030-01264-9_1]
  • Yang Z, Chen W, Wang F and Xu B. 2017. Improving neural machine translation with conditional sequence generative adversarial nets[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1703.04887.pdf
  • Yin J W. 2018. The Research of Robot Simultaneous Localization and Mapping Based on RGBD Camera. (殷剑文. 2018. 基于RGBD的机器人同时定位与制图研究. ) [DOI:10.27675/d.cnki.gcydx.2018.000695]
  • Yu J H, Lin Z, Yang J M, Shen X H, Lu X and Huang T S. 2018. Generative image inpainting with contextual attention[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1801.07892.pdf
  • Yu L T, Zhang W N, Wang J and Yu Y. 2017. SeqGAN: sequence generative adversarial nets with policy gradient[EB/OL].[2020-08-08]. https://arxiv.org/pdf/1609.05473.pdf
  • Zhang H T, Yu J, Wang Z F. 2018. Probability contour guided depth map inpainting and superresolution using non-local total generalized variation. Multimedia Tools and Applications, 77(7): 9003-9020 [DOI:10.1007/s11042-017-4791-x]
  • Zhang M L. 2018. RGB-D Slam Algorithm of Indoor Mobile Robot. Harbin: Harbin Institute of Technology (张米令. 2018. 室内移动机器人RGB-D SLAM算法研究. 哈尔滨: 哈尔滨工业大学)
  • Zhu X Y, Liu Y F, Li J H, Wan T and Qin Z C. 2018. Emotion classification with data augmentation using generative adversarial networks//Proceedings of the 22nd Pacific-Asia Conference on Knowledge Discovery and Data Mining. Melbourne, Australia: Springer: 349-360[DOI:10.1007/978-3-319-93040-4_28]