As the methods evolve, inversion is mainly divided into two steps. The first step is Image Embedding, in which an encoder or optimization process embeds images to get the corresponding latent codes. Afterward, the second step aims to refine the inversion and editing results, which we named Result Refinement. Although the second step significantly improves fidelity, perception and editability are almost unchanged, deeply dependent on inverse latent codes attained in the first step. Therefore, a crucial problem is gaining the latent codes with better perception and editability while retaining the reconstruction fidelity. In this work, we first point out that these two characteristics are related to the degree of alignment (or disalignment) of the inverse codes with the synthetic distribution. Then, we propose Latent Space Alignment Inversion Paradigm (LSAP), which consists of evaluation metric and solution for this problem. Specifically, we introduce Normalized Style Space ($\mathcal{S^N}$ space) and $\mathcal{S^N}$ Cosine Distance (SNCD) to measure disalignment of inversion methods. Since our proposed SNCD is differentiable, it can be optimized in both encoder-based and optimization-based embedding methods to conduct a uniform solution. Extensive experiments in various domains demonstrate that SNCD effectively reflects perception and editability, and our alignment paradigm archives the state-of-the-art in both two steps. Code is available on https://github.com/caopulan/GANInverter/tree/main/configs/lsap.
翻译:随着方法的演进,反演过程主要分为两个步骤。第一步是图像嵌入,通过编码器或优化过程将图像嵌入以获得相应的潜码。随后,第二步旨在优化反演和编辑结果,我们将其称为结果精化。尽管第二步显著提升了保真度,但感知与可编辑性几乎未发生变化,其深度依赖于第一步所获取的反演潜码。因此,一个关键问题在于如何在保持重建保真度的同时,获得具有更优感知与可编辑性的潜码。在本工作中,我们首先指出这两个特性与反演码相对于合成分布的对齐(或非对齐)程度相关。随后,我们提出潜空间对齐反演范式 (LSAP),该范式包含针对该问题的评估指标与解决方案。具体而言,我们引入归一化风格空间($\mathcal{S^N}$空间)和$\mathcal{S^N}$余弦距离 (SNCD) 来衡量反演方法的非对齐程度。由于我们提出的SNCD是可微的,因此可在基于编码器与基于优化的嵌入方法中进行优化,从而形成统一解决方案。跨多个领域的广泛实验表明,SNCD能有效反映感知与可编辑性,且我们的对齐范式在两个步骤中均达到了最先进水平。代码见 https://github.com/caopulan/GANInverter/tree/main/configs/lsap。