[论文解读] Coherent Semantic Attention for Image Inpainting
本文在两阶段U-Net框架内提出了一种新型的相干语义注意力(CSA)层,用于图像修复,通过建模语义相关性和特征连续性,生成高质量、结构一致的结果。通过集成一致性损失和特征块判别器,该方法在CelebA、Places2和Paris StreetView数据集上实现了最先进性能,显著降低了失真度,同时提升了纹理真实感和结构保真度。
The latest deep learning-based approaches have shown promising results for the challenging task of inpainting missing regions of an image. However, the existing methods often generate contents with blurry textures and distorted structures due to the discontinuity of the local pixels. From a semantic-level perspective, the local pixel discontinuity is mainly because these methods ignore the semantic relevance and feature continuity of hole regions. To handle this problem, we investigate the human behavior in repairing pictures and propose a fined deep generative model-based approach with a novel coherent semantic attention (CSA) layer, which can not only preserve contextual structure but also make more effective predictions of missing parts by modeling the semantic relevance between the holes features. The task is divided into rough, refinement as two steps and model each step with a neural network under the U-Net architecture, where the CSA layer is embedded into the encoder of refinement step. To stabilize the network training process and promote the CSA layer to learn more effective parameters, we propose a consistency loss to enforce the both the CSA layer and the corresponding layer of the CSA in decoder to be close to the VGG feature layer of a ground truth image simultaneously. The experiments on CelebA, Places2, and Paris StreetView datasets have validated the effectiveness of our proposed methods in image inpainting tasks and can obtain images with a higher quality as compared with the existing state-of-the-art approaches.
研究动机与目标
- 为解决现有深度学习方法在图像修复中的局限性,这些方法常因忽略语义相关性和特征连续性而导致纹理模糊和结构失真。
- 通过设计两阶段生成框架,模拟人类修复图像的两步过程——先构思整体结构,再细化局部细节。
- 通过引入一致性损失,使CSA层及其对应的解码器层与真实图像的VGG特征对齐,从而提升训练稳定性和特征学习能力。
- 通过用更快、更稳定的特征块判别器替代传统判别器,提升细节生成质量并提高训练效率。
提出的方法
- 该方法采用两阶段U-Net架构:首先通过粗糙网络生成初始内容,随后通过带有CSA层的细化网络提升局部一致性。
- CSA层通过从已知区域中选取最相似的特征块来初始化缺失的特征块,并基于与邻近块的空间一致性进行迭代优化。
- 引入一致性损失,强制CSA层及其对应的解码器层输出的特征与真实图像的VGG特征表示保持接近。
- 使用特征块判别器替代标准的块判别器,以提升细节质量与训练稳定性,并实现更快的推理速度。
- 模型通过重建损失、相对平均最小二乘对抗损失以及所提出的 consistency loss 的组合进行训练。
- 带有CSA的细化网络被专门设计为在保持全局语义结构的同时,通过迭代特征优化确保局部像素的连续性。
实验结果
研究问题
- RQ1建模孔洞区域之间的语义相关性和特征连续性,是否能提升图像修复质量并减少结构伪影?
- RQ2两阶段细化过程——先粗略预测,再通过CSA进行细化——与端到端方法相比,在保持全局结构和局部细节方面表现如何?
- RQ3一致性损失在多大程度上提升了训练稳定性并改善了与真实VGG特征的对齐?
- RQ4所提出的特征块判别器是否在生成清晰纹理和减少模糊方面优于传统块判别器?
- RQ5在细化网络中,CSA层的最佳放置位置是什么,以在性能与推理效率之间取得最佳平衡?
主要发现
- 在使用中心遮挡掩码的CelebA数据集中,该方法在40-50%孔洞比例下达到PSNR 24.14和SSIM 0.883,优于上下文注意力(PSNR: 23.36, SSIM: 0.860)和部分卷积(PSNR: 22.11, SSIM: 0.839)。
- 在CelebA上使用不规则掩码时,该方法在20-30%孔洞比例下达到PSNR 32.58和SSIM 0.982,优于门控卷积(PSNR: 29.83, SSIM: 0.964)和部分卷积(PSNR: 29.10, SSIM: 0.956)。
- 消融实验表明,若将CSA替换为传统3×3卷积,将导致严重的结构失真;而仅使用上下文注意力仍会产生不一致的纹理。
- 将CSA层置于第三级下采样阶段(32×32特征图)时,实现了推理速度(每张图像0.82秒)与性能之间的最佳平衡。
- 一致性损失显著减少了孔洞区域的结构失真,尤其在无该损失时训练不稳定的情况下,定性对比结果明显显示其优势。
- 特征块判别器相比标准块判别器,提升了细节质量并减少了模糊,且每张图像处理时间快0.2秒。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。